91
3rd Party Plugins - (fb2k) / Re: [fb2k v2] SQL Tree (foo_uie_sql_tree)
Last post by dpc666 -What I would like to happen is that only the most recent played date of the entire artist's discography gets displayed.Ok, that's exactly what the query I posted is doing. So my only guess is that you made a mistake while transferring my posted query to your tree. Could you please also post the query which you are using?
I simply copy-pasted it.
Code: [Select]
WITH Albums AS (
SELECT a.*,
avg(CAST(playcount AS INTEGER)) OVER wAlbum playcount,
max(lastplayed) OVER wArtist lastplayed
FROM (
SELECT path,
subsong,
playcount,
lastplayed,
ifnull("album artist",artist) album_artist,
album,
(CASE WHEN discnumber THEN 'Disc '||discnumber ELSE NULL END) disc_number
FROM MediaLibrary
) a
WINDOW wAlbum AS (PARTITION BY album_artist,album),
wArtist AS (PARTITION BY album_artist)
)
SELECT '['||lastplayed||'] '||album_artist,
'['||CAST(playcount AS TEXT)||'] '||album,
disc_number
FROM Albums
ORDER BY lastplayed,album_artist,album,disc_number
playcount and lastplayed use TFExpressions (Text) %play_count% and %last_played%, respectively, if that is relevant.
It doesn't seem like that should make a difference to anything, but I'm running Foobar2000 through Wine on Linux.