You are here: Home » Topic » Smart Playlists – Shuffling and Limit

Smart Playlists – Shuffling and Limit

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #332
    kit
    Guest

    I’ve been looking at creating a solution for the problem of being able to rapidly play a shuffled playlist either from a large subset of my media, or from all media items.

    Last night I got myself familar with the code base and modified db-generic.c to order the playlist items results in random order. sqlite supports “order by RANDOM()” in its queries which makes this simple. I confirmed that DAAP requests then got randomized results. If I were to combine this with a limit to the query, the SoundBridge would be able to receive a short playlist (300-500 should be more than enough for most use cases). This would allow people to play a shuffle all, without the long wait and stability issues that people like myself have with very large music libraries.

    I looked over the way the RSP code handles playlists, and the protocol seems to have a concept of limiting the result set, but it doesn’t seem that the SoundBridge leverages this (yet). Are there already plans in the works to address this issue, or should I pursue a approach along these lines?

    What I was thinking about doing was extending the smart playlist language in order to allow people to specifiy a max results and a shuffle option. Based on the current code base this would have to be done once in the DAAP code and once in the RSP code.

    Thoughts?

    #4944
    rpedde
    Participant

    @kit wrote:

    I looked over the way the RSP code handles playlists, and the protocol seems to have a concept of limiting the result set, but it doesn’t seem that the SoundBridge leverages this (yet). Are there already plans in the works to address this issue, or should I pursue a approach along these lines?

    True, that’s for paging through the result set not really for making a playlist of a limited number of items.

    Random playlists and custom order by playlists are on the map, but post 1.0. I’m trying to stabilize for a 1.0 release now.

    What I was thinking about doing was extending the smart playlist language in order to allow people to specifiy a max results and a shuffle option. Based on the current code base this would have to be done once in the DAAP code and once in the RSP code.

    That’s the best first step. I was going to make them optional directives just before the start of the criteria. Something like:

    order album,ascending;track,ascending
    limit 20
    artist includes “morrissey”

    or:

    order random
    limit 100
    rating > 60

    Something like that.

    #4945
    mattb
    Participant

    Just thought I’d chime in here too. Smart playlists are a fantastic feature, and one that sets Firefly from most others.

    I love the start you have on them, but I agree the randomization and limiting the number of records returned would be great. Even if we could just do a passthrough sql query without much of an interface that would be great.

    Keep up the good work!

    #4946
    fizze
    Participant

    wow, sounds promising.

    but, the smart playlists too are always based upon songs /tracks, right ?

    What about a feature like “random album” ?
    basically, instead of a
    SELECT ID FROM SONGS WHERE blabla
    wouldnt it be nice to be able to do a

    SELECT ID FROM SONGS WHERE blabla GROUP BY ALBUM;

    of course, that would be 2 query modes, and the SB would have to honor the different grouping. Maybe it can group the stuff itself, I donno…?

    #4947
    grommet
    Participant

    @fizze wrote:

    The SB would have to honor the different grouping. Maybe it can group the stuff itself, I donno…?

    Regarding “Playlists”, SoundBridge does zero sorting (by design). It plays in the order the server exposes it. Well, unless you press the shuffle track button… 8)

    If the tracks in the generated playlist were in “Random Album” grouping, it would work fine.

    #4948
    rpedde
    Participant

    @grommet wrote:

    @fizze wrote:

    The SB would have to honor the different grouping. Maybe it can group the stuff itself, I donno…?

    Regarding “Playlists”, SoundBridge does zero sorting (by design). It plays in the order the server exposes it. Well, unless you press the shuffle track button… 8)

    If the tracks in the generated playlist were in “Random Album” grouping, it would work fine.

    But that’s what everyone is always unhappy about, that the server returns stuff in unsorted order! (static playlists, particularly)

    Lol.

    #4949
    fizze
    Participant

    yeah, the SB is pretty dumb, but thats ok 😉

    well, if the SB does no sorting then its mt-daapd that does sorting in playlists etc., which is not so clever actually.

    I found that those are sorted by artist ?
    wheres the code that “sorts” or scans the playlists ?

    #4950
    rpedde
    Participant

    @fizze wrote:

    yeah, the SB is pretty dumb, but thats ok 😉

    well, if the SB does no sorting then its mt-daapd that does sorting in playlists etc., which is not so clever actually.

    I found that those are sorted by artist ?
    wheres the code that “sorts” or scans the playlists ?

    Isn’t any. I’m about to order the playlists again, but last time it was too heavy for the NSLU2, so I’ll make it a config option.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.