"top … order by" Syntax for smart playlists

FireFly Media Server Firefly Media Server Forums Firefly Media Server Feature Requests "top … order by" Syntax for smart playlists

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1431
    Goenk
    Participant

    I think it would be really useful to be able to limit a smart-playlist to the top n entries, based on some kind of ordering (could be just a single column and a direction).

    The combination of sort and top makes it useful, even if the songs are returned in a different order: with it, i could make smart playlists like the following:
    – “get the 20 newest songs”
    – “get the 100 best rated punk-rock songs”
    – “get the 25 least played songs”
    – etc., etc.

    Actually, I believe that this would satisfy quite a lot of the request I’ve seen on this forum.

    I do realize that SQLite does not have a “top” operator, but I’m guessing that truncating the result-list could be done rather easily in code, and i checked that is has got the “order by” functionality that is needed for this to work efficiently.[/list]

    #10930
    rpedde
    Participant

    @Goenk wrote:

    I think it would be really useful to be able to limit a smart-playlist to the top n entries, based on some kind of ordering (could be just a single column and a direction).

    The combination of sort and top makes it useful, even if the songs are returned in a different order: with it, i could make smart playlists like the following:
    – “get the 20 newest songs”
    – “get the 100 best rated punk-rock songs”
    – “get the 25 least played songs”
    – etc., etc.

    Actually, I believe that this would satisfy quite a lot of the request I’ve seen on this forum.

    I do realize that SQLite does not have a “top” operator, but I’m guessing that truncating the result-list could be done rather easily in code, and i checked that is has got the “order by” functionality that is needed for this to work efficiently.[/list]

    Yup. This is far and away the biggest request. I want to not do it using sql, though — I have to have a way to do it for non-sql backends as well, which sort of complicates it, but yeah, that’s something I want too..

    — Ron

    #10931
    fizze
    Participant

    Well, this isnt easy to code then, especially since every “limit by” case would have to be coded specifically.
    Maybe just remove this feature for non-sql backends (there arent any, so far, anyhow). But then I haven’t seen gdbm on a NSLU2, which is supposedly faster and scales better *shrug*

    Still I’d say that recoding this part is not for the faint of heart.
    0.02€

    #10932
    mpoly
    Participant

    There are lots of requests on playlists, many of which are quite hard to implement because they require Ron to expand and parse more complicated expressions.

    Here’s an idea: Allow smart playlist expressions in the format:

    SQL:

    Where sqlstatement is any SQL that returns a list of Ids from the database. This could be an expert-only feature, with disclaimers:

      This is not officially supported
      There is no syntax checking
      Portability and compatibility with future versions is not guaranteed
      If you accidentally type in DROP TABLE, its your problem.

    For those who know basic SQL (and those who know how to ask questions nicely in the forums), this will open many new possibilities.

    ?

    #10933
    fizze
    Participant

    nice idea, doesnt even have to be syntax checked or parsed at all.
    Just blatantly insert and execute that statement 😉

    keep it simple, stupid 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Feature Requests’ is closed to new topics and replies.