Add category filters to Upcoming calendar (#3607)
This commit is contained in:
@@ -164,6 +164,33 @@ FROM mangas
|
||||
WHERE next_update >= :startOfDay
|
||||
AND favorite = 1
|
||||
AND status IN :statuses
|
||||
AND (
|
||||
-- includedEmpty being true expresses "don't care" state and bypasses the membership filter
|
||||
:includedEmpty
|
||||
OR EXISTS (
|
||||
SELECT 1 FROM mangas_categories
|
||||
WHERE mangas_categories.manga_id = mangas._id
|
||||
AND COALESCE(mangas_categories.category_id, 0) IN :includedCategories
|
||||
)
|
||||
OR (0 IN :includedCategories AND NOT EXISTS (
|
||||
SELECT 1 FROM mangas_categories WHERE mangas_categories.manga_id = mangas._id)
|
||||
)
|
||||
)
|
||||
AND (
|
||||
-- excludedEmpty being true expresses "don't care" state and bypasses the membership filter
|
||||
:excludedEmpty
|
||||
OR (
|
||||
NOT EXISTS (
|
||||
SELECT 1 FROM mangas_categories
|
||||
WHERE mangas_categories.manga_id = mangas._id
|
||||
AND COALESCE(mangas_categories.category_id, 0) IN :excludedCategories
|
||||
)
|
||||
AND (
|
||||
0 NOT IN :excludedCategories
|
||||
OR EXISTS (SELECT 1 FROM mangas_categories WHERE mangas_categories.manga_id = mangas._id)
|
||||
)
|
||||
)
|
||||
)
|
||||
ORDER BY next_update ASC;
|
||||
|
||||
resetViewerFlags:
|
||||
|
||||
Reference in New Issue
Block a user