Skip to content

Commit 8a19606

Browse files
committed
Take into account artists and albums that have been marked as permanent.
1 parent f5de024 commit 8a19606

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

subdaap/cache.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,19 @@ def get_cached_items(self):
410410
`items`.`file_suffix`
411411
FROM
412412
`items`
413+
LEFT OUTER JOIN
414+
`artists` ON `items`.`artist_id`=`artists`.`id`
415+
LEFT OUTER JOIN
416+
`albums` ON `items`.`album_id`=`albums`.`id`
413417
WHERE
414-
`items`.`cache` = 1 AND
415-
`items`.`exclude` = 0
418+
(
419+
`items`.`cache` = 1 OR
420+
COALESCE(`artists`.`cache`, 0) = 1 OR
421+
COALESCE(`albums`.`cache`, 0) = 1
422+
) AND
423+
`items`.`exclude` = 0 AND
424+
COALESCE(`artists`.`exclude`, 0) = 0 AND
425+
COALESCE(`albums`.`exclude`, 0) = 0
416426
""")
417427

418428
def cache(self):

0 commit comments

Comments
 (0)