Try if something like this works:

Code:
--------------------
    
  -- PlaylistName:Bach - Piano - Album random
  -- PlaylistGroups:
  -- PlaylistOptionContentType:album
  -- PlaylistOptionDontRepeatTracks:1
  -- PlaylistOptionUnlimited:1
  select tracks.album from tracks
        join contributor_track on
                tracks.id=contributor_track.track
        join contributors on
                contributor_track.contributor=contributors.id 
                and contributor_track.role in (1,5)
        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 and 
dynamicplaylist_history.client='PlaylistPlayer'
        where
                audio=1
                and dynamicplaylist_history.id is null
                and contributors.name like ('Bach%')
                and genres.name in ('Piano')
        group by tracks.album
        order by rand()
        limit 1;
  
--------------------


"PlaylistOptionContentType:album" results in that SQL Playlist want the
SQL to return album id's instead of track url's.

"PlaylistOptionDontRepeatTracks:1" makes sure it only plays tracks on
the album that haven't already been played, I'm not completely sure you
need this, it might work without it.

"PlaylistOptionUnlimited:1" makes sure it always add a complete album
and not just enough tracks of the album to fill the playlist to the
wanted size.


-- 
erland

Erland Isaksson
'My homepage' (http://erland.isaksson.info) (Install my plugins through
Extension Downloader)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library, Title Switcher and Database
Query plugins'
(http://wiki.erland.isaksson.info/index.php/Category:SlimServer))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=75816

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to