PasTim wrote:
> I don't get truncation with this SQL. I don't see why you should.
>
> What this SQL does is select 10 Works and lists them in a table. It
> then plays all the tracks in each Work, however many there are. When
> near the end of the playlist it selects another 10 Works (not tracks).
> That's why there are two separate steps. If done in one SQL statement
> you will get truncation.
>
> It may be that I have misunderstood your problem, but with this SQL (and
> variations on it) I have sat for many hours playing tens of random
> 'works' (some of which have 50 or more tracks) with no problem. It's
> one of the tools I use the most.
Thanks for the response, PasTim. Maybe I am missing something obvious. I
use the following SQL, which works fine from "Test/Save & Play" in the
SQL playlist menu.
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
GROUP BY tracks.album, customscan_track_attributes.value
ORDER BY random();
SELECT tracks.url FROM
(SELECT rowid AS albumworks_id, album as albumworks_album, work, playcount
from albumworks WHERE playcount > 0 limit 10)
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;
--------------------
However, when I run it as a dynamic playlist (easily accessed from
iPeng, etc.), it only plays the first 10 tracks and then gets one track
at a time, disregarding any work in progress.
16691
Does that make sense? What should I do differently?
+-------------------------------------------------------------------+
|Filename: works1.png |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=16691|
+-------------------------------------------------------------------+
------------------------------------------------------------------------
mps's Profile: http://forums.slimdevices.com/member.php?userid=36351
View this thread: http://forums.slimdevices.com/showthread.php?t=49483
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins