haschmich wrote:
> I also just realised that my very few SQL Playlists no longer work.
> Could you help me make it work again with DPL 3.2.1? The main one was
> supposed to play "random songs with rating 7 or above and not recently
> played" and looks like this:
>
> >
Code:
--------------------
> > -- PlaylistName:Top rated songs 7 plus
> -- PlaylistGroups:
> select tracks.url from tracks
> join track_statistics on
> tracks.url=track_statistics.url
> 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 track_statistics.rating>=70
> group by tracks.id
> order by rand()
> limit 10;
--------------------
> >
>
> It would be perfect if the rating threshold could be chosen
> dynamically...
>
> Thanks a lot for your work on the plugin!
Are you using -mysql- or -sqlite?- DPLv3 is sqlite only.
While you still need plugins like TrackStat or RatingsLight for setting
ratings you don't need any plugin at all for retrieving ratings from LMS
directly. If your LMS database is standard sqlite this playlist should
probably work:
Code:
--------------------
-- PlaylistName:Top rated songs 7 plus
-- PlaylistParameter1:list:Select minimum
rating:0:0,10:1,20:2,30:3,40:4,50:5,60:6,70:7,80:8,90:9,100:10
select distinct tracks.url from tracks
join tracks_persistent on
tracks_persistent.urlmd5 = tracks.urlmd5 and
tracks_persistent.rating >= 'PlaylistParameter1'
left join dynamicplaylist_history on
dynamicplaylist_history.id=tracks.id and
dynamicplaylist_history.client='PlaylistPlayer'
where
tracks.audio = 1
and dynamicplaylist_history.id is null
and tracks.secs >= 'PlaylistTrackMinDuration'
and not exists (select * from tracks t2,genre_track,genres
where
t2.id=tracks.id and
tracks.id=genre_track.track and
genre_track.genre=genres.id and
genres.name in
('PlaylistExcludedGenres'))
group by tracks.url
order by random()
limit 'PlaylistLimit';
--------------------
------------------------------------------------------------------------
afriend's Profile: http://forums.slimdevices.com/member.php?userid=39306
View this thread: http://forums.slimdevices.com/showthread.php?t=115073
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins