mps wrote:
> Hi Pastim,
> Here is my SQL for playing works (The playcount test is because I only
> want to choose from works that I have already played at least once).
> Note that the second image I posted above shows that the SQL Playlist is
> not truncated when I run it in "test" mode, only when I use Dynamic
> Playlists to actually listen to it.
> >
Code:
--------------------
> > -- PlaylistName:Random Played Works
> -- PlaylistGroups:
> DROP TABLE IF EXISTS albumworks;
>
> CREATE TEMPORARY TABLE IF NOT EXISTS albumworks
> AS SELECT tracks.album AS album, customscan_track_attributes.value as work,
Ifnull(track_statistics.playcount, 0) as playcount
> FROM tracks
> JOIN multilibrary_track
> LEFT JOIN track_statistics
> JOIN customscan_track_attributes
> ON tracks.id = customscan_track_attributes.track
> AND tracks.url = track_statistics.url
> AND customscan_track_attributes.module = 'customtag'
> AND customscan_track_attributes.attr = 'WORK'
> AND tracks.id=multilibrary_track.track
> AND multilibrary_track.library=2
> WHERE playcount > 0 GROUP BY tracks.album, customscan_track_attributes.value
> ORDER BY random() limit 10 ;
>
> SELECT tracks.url FROM
> (SELECT rowid AS albumworks_id, album as albumworks_album, work, playcount
from albumworks)
> JOIN tracks
> JOIN customscan_track_attributes
> ON tracks.id = customscan_track_attributes.track
> AND customscan_track_attributes.module = 'customtag'
> AND customscan_track_attributes.attr = 'WORK'
> AND customscan_track_attributes.value = work
> AND tracks.album = albumworks_album
> ORDER BY albumworks_id, tracks.tracknum;
>
--------------------
> >
Mine is similar, but I note that I have ' PlaylistOption Unlimited:1'
near the start.
http://wiki.erland.isaksson.info/index.php/SQL_Playlist_plugin seems to
indicate that this could be the problem.
Code:
--------------------
-- PlaylistName:Random Classical Works
-- PlaylistGroups:Random
-- PlaylistOption Unlimited:1
create temporary table sqlplaylist_random_work as
select customscan_track_attributes.extravalue as work, tracks.album as album
from customscan_track_attributes
join tracks on
customscan_track_attributes.track = tracks.id
left join dynamicplaylist_history on
tracks.id=dynamicplaylist_history.id and
dynamicplaylist_history.client='PlaylistPlayer'
where
customscan_track_attributes.module='mixedtag' and
customscan_track_attributes.attr='WORK' and
dynamicplaylist_history.id is null and
audio=1
group by customscan_track_attributes.extravalue, tracks.album
order by random()
limit 10;
select tracks.url from tracks
join customscan_track_attributes on tracks.id =
customscan_track_attributes.track
join sqlplaylist_random_work on tracks.album =
sqlplaylist_random_work.album
where sqlplaylist_random_work.work =
customscan_track_attributes.extravalue and
customscan_track_attributes.module='mixedtag' and
customscan_track_attributes.attr='WORK' and
audio=1
group by tracks.id
order by tracks.album,tracks.disc,tracks.tracknum;
drop table sqlplaylist_random_work;
--------------------
LMS 7.9 on VortexBox Midi, Xubuntu 14.04, FLACs 16->24 bit,
44.1->192kbps. LMS & Squeeze2upnp (Beta - derived from squeezelite) to
Musical Fidelity M1 CLiC and Marantz CR603 UPnP renderers. Squeezelite
to PC sound. Minimserver (server) and upplay (control point) to same
amps & to upmpdcli/mpd PC renderers. Meridian USB Explorer DAC from PCs
to speakers/headphones. Wireless Xubuntu 14.04 laptop controls
LMS/upplay via Firefox. Have a Touch with EDO, and a spare, but don't
use.
------------------------------------------------------------------------
PasTim's Profile: http://forums.slimdevices.com/member.php?userid=41642
View this thread: http://forums.slimdevices.com/showthread.php?t=49483
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins