DrNic wrote:
> I'm just tetchy thanks to the 1 week old new arrival at home that won't
> sleep - any suggestions for that?! :) 

SQLPlaylist to the rescue!

-- PlaylistName:Sleep with Lullabies
-- PlaylistGroups:
-- PlaylistOption Unlimited:1
-- PlaylistStartAction1:cli:mixer volume 50
-- PlaylistStartAction2:cli:sleep 3600
create temporary table sqlplaylist_random_albums (primary key (album))
         select tracks.album from tracks
                 join genre_track on
                         tracks.id=genre_track.track
                 join genres on
                         genre_track.genre=genres.id
                 left join dynamicplaylist_history on
                         tracks.id=dynamicplaylist_history.id
                 where
                         audio=1
                         and dynamicplaylist_history.id is null
                         and genres.name in ('Lullaby')
                 group by tracks.album
                 order by rand()
                 limit 1;
select tracks.url from tracks
         join sqlplaylist_random_albums
                 on tracks.album=sqlplaylist_random_albums.album
         join genre_track on
                 tracks.id=genre_track.track
         join genres on
                 genre_track.genre=genres.id
         left join dynamicplaylist_history on
                 tracks.id=dynamicplaylist_history.id
         where
                 audio=1
                 and dynamicplaylist_history.id is null
                 and genres.name in ('Lullaby')
         group by tracks.id
         order by sqlplaylist_random_albums.album,tracks.tracknum;
drop temporary table sqlplaylist_random_albums;

:)

- Marc
_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/discuss

Reply via email to