RobbH wrote:
> My goal is to set up a playlist that only plays files that have both
> 'Jazz' and 'Holiday' tags. All attempts so far have failed miserably.
>
You can do it with exists directive and an inner select, something like
this:
Code:
--------------------
-- PlaylistName:Random temp
-- PlaylistGroups:
select tracks.url 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 and
dynamicplaylist_history.client='PlaylistPlayer'
where
audio=1
and dynamicplaylist_history.id is null
and genres.name in ('Jazz')
and exists (select track from genre_track
join genres on
genre_track.genre=genres.id
where
genres.name in ('Holiday')
and genre_track.track = tracks.id)
group by tracks.id
order by random()
limit 10;
--------------------
Please note that inner selects could be slow in large libraries, in that
case there is might also a possibility to do it through an extra set of
joins.
Erland Isaksson ('My homepage' (http://erland.isaksson.info))
LEAD PLATFORM DEVELOPER OF 'ICKSTREAM MUSIC PLATFORM'
(HTTP://WWW.ICKSTREAM.COM) - A WORLD OF MUSIC AT YOUR FINGERTIPS
(Also developer of 'many plugins/applets'
(http://wiki.slimdevices.com/index.php/User:Erland))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=109818
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins