Random mix according to song length

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jaybeee
    Member
    • Nov 2005
    • 44

    Random mix according to song length

    Apologies if this has been discussed or is a 3rd party plugin (and really sorry if it is part of the standard functionality), but I did search:

    I really enjoy the Random song/artist/album etc functionality, but wondered if it is / would be possible to have this Random functionality work for songs that are less than (or greater than) a defined time limit?

    For example, I have a lot of DJ mixes with some being 2 hours in duration, and when the Random mix is activated then many such long mixes can get into the selection... and a 2 hour mix is not what I'd call a Random mix (to the code it is, but not for my needs). Sure, all I need to do is skip to the next queued up track, but that kinda defeats the object.

    What d'ya think?
  • erland
    Senior Member
    • Jan 2006
    • 11323

    #2
    You can do it with the SQLPlayList plugin.

    The following SQL query would result in a random playlist with all songs in "Pop" or "Rock" genre that is less than 6 minutes long.
    Code:
    select url from tracks,genre_track,genres 
    	where tracks.id=genre_track.track and 
    		genre_track.genre=genres.id and
    		tracks.audio=1 and 
    		genres.name in ('Pop','Rock') and
    		tracks.secs<360
    	 order by random() limit 10;
    The following SQL query would result in a random playlist with all songs in your whole collection that is less than 10 minutes long.
    Code:
    select url from tracks 
    	where tracks.audio=1 and 
    		tracks.secs<600 
    	order by random() limit 10;
    Erland Lindmark (My homepage)
    Developer of many plugins/applets
    Starting with LMS 8.0 I no longer support my plugins/applets (see here for more information )

    Comment

    • jaybeee
      Member
      • Nov 2005
      • 44

      #3
      Ok thanks. I didn't think it would be too difficult, just wondered if it was easily possible. I’ll take a look at your plugin.

      Comment

      Working...