FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › Feature Requests › "top … order by" Syntax for smart playlists
- This topic has 4 replies, 4 voices, and was last updated 17 years, 2 months ago by fizze.
-
AuthorPosts
-
28/05/2007 at 12:09 PM #1431GoenkParticipant
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]
29/05/2007 at 3:41 AM #10930rpeddeParticipant@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
29/05/2007 at 6:55 AM #10931fizzeParticipantWell, 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€13/07/2007 at 11:18 AM #10932mpolyParticipantThere 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.
?
13/07/2007 at 2:29 PM #10933fizzeParticipantnice idea, doesnt even have to be syntax checked or parsed at all.
Just blatantly insert and execute that statement 😉keep it simple, stupid 🙂
-
AuthorPosts
- The forum ‘Feature Requests’ is closed to new topics and replies.