Smart playlists added
#1
hi all,

i just added loading of smart playlist files for xbmc.

smart playlists basically define a set of rules for songs from the music library. they're in the form of an xml file (renamed to .xsp) and can only be loaded from xbmc (ie cannot be set up from within the xbmc gui at present). the .xsp's should be placed in your playlist/music location (usually in the albums/ folder). they cannot be loaded off remote shares at this point. if they're in the music playlists folder, then you'll ne able to view them in the playlists entry in the music library view.

they allow you to define rules for which to filter your music library. for instance, the following .xsp

Quote:<smartplaylist>
<name>party mode</name>
<match>all</match>
<rule field="artist" operator="is">u2</rule>
<rule field="year" operator="greaterthan">1990</rule>
</smartplaylist>

grabs all u2 music from after 1990.

you can have as many <rule>'s as you like.

more information is on the file format and the allowed tags and attributes are available in the online manual:

http://manual.xboxmediacenter.de/wakka.p....p;v=tep

enjoy, and please let us know what other stuff you'd like to see on this front (such as other filtering fields and matching methods etc.)

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
#2
very nice,

maybe this for a field parameter.
"kind" - mp3,wav...

edit: in the manual for track naming template there's a %j - date. if that's the date added then.

"dateadded"



For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
#3
nto sure if filtering by path is supported but if so you could
<rule field="path" operator="contains">.mp3</rule>
#4
jonathan,

firstly, excellent feature.

i dont want to be accused of "its never enough" but could i ask a question on the feasability of introducing (like winamp) the 'amount of change' between one track to the next.

i'm assuming this is based on the id3 bpm tag.

the reason is because at the moment party mode selection can swing wildly from anytrack to anytrack.
ie. prodigy 'firestarter' to my sons nursery rhymes and back to anything else.

restricting to a genre does help eliminate this, but with a large genere such as 'rock' the large bpm swing still exists.

just an idea and i realise theres a feature freeze imminent, but was wondering if its doable ?

cheers
#5
these smart playlists only define a sql query against the db. this is doable with a db update. we would need to need to start pulling info from the bpm tag and storing the values in the database. once the db is updated to store this data, you would then need to delete and rescan so as to populate this new field.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
#6
this is excellent!

i also like bbb's idea and would love to see that implimented.

i personally would use the genre filtering but i could definitely see his thoughts... especially if they decide to let me breed one day  :nuts:



I'm not an expert but I play one at work.
#7
glad you guys like it.

obviously this is only iteration 1. it only has 5 fields to match against.

let's make a list of the fields we would like to be able to restrict on:

title
artist
album
year
genre
time
track number
filename
play count

bitrate
bpm
date (modify date, or creation date, or date added?)
rating
last played

playlist (ie whether it is in another smart playlist)

the first ones i think can be done now as the info is already there. the next 5 will require database updates and tagging updates.

the last one might be useful for additional filtering (eg select all songs in playlist 1 not in playlist 2 to allow multiple or and and operations).

i'll look into adding support for the first ones when i have some time.

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
#8
file date please!

(for when we gonna update database anyway)
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
#9
yes, had it listed there.

there's 3 options as i see it for date:

file creation
file modify
date added to db.

i think file modify is possibly the best one (it's the one we use for sort by date i think?), though date added to db is also useful once we get an auto-music scanner background updating the database regularly.

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
#10
auto-music scanner background updating

now that is music to my ears! been hoping for that feature for a while.
#11
(bigbellybilly @ mar. 09 2006,15:40 Wrote:auto-music scanner background updating

now that is music to my ears!  been hoping for that feature for a while.
ditto!

if we could get the same thing for the videos that would be superb!
I'm not an expert but I play one at work.
#12
sounds like a great addition, but i'm having trouble getting it to work. i've copied the example from jmarshall's original post and put it in a file named foo.xsp in 'e:\xbmcdata\playlists\music\' but when i navigate to playlists in library view i can only see my existing m3u playlists. same happens if i browse to the folder in files view. i also tried the following (in a file named 2000.xsp) with the same result:
Quote:<smartplaylist>
<name>2000</name>
<match>all</match>
<rule field="year" operator="is">2000</rule>
</smartplaylist>
i have my playlist folder set as follows in xboxmediacenter.xml:
Quote: <!-- directory to put playlists in !-->
<playlists>e:\xbmcdata\playlists</playlists>
unless i'm missing something obvious, the only thing i can see that i'm doing differently is that i've changed my playlist folder. i'm using a build from 12th march (it has .xsp listed as a music extension in xboxmediacenter.xml). can anyone else shed some light?
#13
if the .xsp extension files are not showing up in music views, then it sounds to me like the xboxmediacenter.xml file that xbmc is using does not have the .xsp extension listed.

are you running as dash? did you update xboxmediacenter.xml (what about the xbe?) on c:?

btw: filename, time, playcount and tracknumber have been added as fields to filter on.

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
#14
that was it, thanks. it's working perfectly now. it's not the first time that one's caught me out either Blush

i can see this will be really useful. one nice addition i can think of would be the ability to group (or at least sort) by a particluar field (e.g album/artist). at the moment all track 1s are together followed by all the track 2s etc. i guess this is just an 'order by' clause on the sql?
#15
well, actually i thought i'd leave the sorting up to the filelister after the results are returned - saves having a separate tag in the smart playlist, and allows you to change order of one easily.

as for you getting caught out on the xbe thing - it's easy to happen, but can be prevented easily:

install a shortcut xbe (see the latest t3ch builds, or on xbox-scene for the shortcut maker) on c:, pointing it to the "real" xbe on e:\apps\xbmc or wherever your prefer.

that way everything is in the same dir. more info in the online manual in my sig - use method 2 in the install as dash section.

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image

Logout Mark Read Team Forum Stats Members Help
Smart playlists added0