Weird query issue. If I put this into the batch tab (pasting directly or linking):
DROP VIEW IF EXISTS view_albumartist;
CREATE VIEW view_albumartist AS
SELECT CASE albumartist
WHEN 'Various'
THEN 'Various'
ELSE upper(
substr(
albumartistsortcoal
, 1, 1
)
)
END
AS initial
, albumartistcoal
, albumartistsortcoal
, albumcoal
, albumsortcoal
, datesortcoal
, releasesortorder
, discnumber
, tracknumber
, path
, subsong
FROM view_medialibrary
WHERE CAST(ifnull(hideflags, 0) AS INTEGER) < 2
AND filename_ext NOT LIKE '%.wav'
;
DROP VIEW IF EXISTS tree_library_albumartist;
CREATE VIEW tree_library_albumartist AS
SELECT (CASE WHEN initial >= ' ' AND initial <= 'B' THEN '# to B'
WHEN initial >= 'C' AND initial <= 'D' THEN 'C to D'
WHEN initial >= 'E' AND initial <= 'G' THEN 'E to G'
WHEN initial >= 'H' AND initial <= 'L' THEN 'H to L'
WHEN initial >= 'M' AND initial <= 'O' THEN 'M to O'
WHEN initial >= 'P' AND initial <= 'S' THEN 'P to S'
ELSE 'T to Z, Various'
END)
AS initgroup
, albumartistcoal
, albumcoal
||' (' || substr(datesortcoal, 1, 4) || ')'
AS albumdate
, path
, subsong
FROM view_albumartist
ORDER BY albumartistsortcoal
, datesortcoal
, albumsortcoal
, releasesortorder
, discnumber
, tracknumber
…and then this into the query tab:
SELECT initgroup
, albumartistcoal
, albumdate
FROM tree_library_albumartist
…then things work as expected.
However, if I put just that first SELECT statement in the batch and the SELECT portion of the second one (minus the path and subsong fields) into the query, then the treeview will fill with all the right nodes, but nothing will be sent to the playlist on clicking.
Further puzzler: the working version will not work if the Omit not existing files when sending to a playlist box is checked, only working when it is not. I like to think that the files exist: they play like they do.