PDA

View Full Version : Random mix according to song length



jaybeee
2006-05-08, 08:59
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
2006-05-08, 09:48
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.


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.


select url from tracks
where tracks.audio=1 and
tracks.secs<600
order by random() limit 10;

jaybeee
2006-05-09, 00:07
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.