afriend wrote: 
> You want the track urls so you start with the tracks table. If you used
> DPL to select the genre (user input parameter) then DPL would look up
> the genre ID and therefore all the (built-in) dynamic playlist use the
> genre_track table (which only matches genre IDs and track IDs). Since
> you want to use the genre name you'll also need the genre table with the
> names.
> No guarantees - here's my version:
> 
> > 
Code:
--------------------
  >   > -- PlaylistName:Jazz-Pop
  > -- PlaylistGroups:Soft
  > -- PlaylistCategory:songs
  > 
  > select distinct tracks.url from tracks
  > join genre_track on
  > tracks.id = genre_track.track
  > join genres on
  > genre_track.genre = genres.id and genres.name like '%%Jazz%%'
  > left join dynamicplaylist_history on
  > dynamicplaylist_history.id=tracks.id and 
dynamicplaylist_history.client='PlaylistPlayer'
  > where
  > tracks.audio = 1
  > and tracks.secs >= 'PlaylistTrackMinDuration'
  > and dynamicplaylist_history.id is null
  > group by tracks.id
  > order by random()
  > limit 'PlaylistLimit';
  > 
--------------------
> > 

Thanks!

I gave up and installed SQL Playlist.



SB Touch optical to Hegel H90, Speakers Larsen 4.2
Spare SB3
AirPlay Bridge to Audio Pro A10
Squeezelite-x connected to home LMS with ZeroTier One.
SB Radio
ReadyNAS 202
iPeng
------------------------------------------------------------------------
bernt's Profile: http://forums.slimdevices.com/member.php?userid=1342
View this thread: http://forums.slimdevices.com/showthread.php?t=115073

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

Reply via email to