From 3863908762f8509b460f423cf7599c1fab9b7aea Mon Sep 17 00:00:00 2001 From: blissful Date: Mon, 29 Apr 2024 16:34:46 -0400 Subject: [PATCH] include secondary genres in genres view --- rose/cache.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rose/cache.py b/rose/cache.py index 0dba38a..4c0cafe 100644 --- a/rose/cache.py +++ b/rose/cache.py @@ -1843,12 +1843,19 @@ def list_releases_delete_this( genres = [genre_filter] genres.extend(TRANSIENT_CHILD_GENRES.get(genre_filter, [])) query += f""" - AND EXISTS ( - SELECT * FROM releases_genres - WHERE release_id = id AND genre IN ({",".join(["?"]*len(genres))}) + AND ( + EXISTS ( + SELECT * FROM releases_genres + WHERE release_id = id AND genre IN ({",".join(["?"]*len(genres))}) + ) + OR EXISTS ( + SELECT * FROM releases_secondary_genres + WHERE release_id = id AND genre IN ({",".join(["?"]*len(genres))}) + ) ) """ args.extend(genres) + args.extend(genres) if label_filter: query += """ AND EXISTS (