mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix: Perhaps?
This commit is contained in:
parent
d6edbae357
commit
b1beed687e
2 changed files with 11 additions and 11 deletions
|
@ -13,7 +13,17 @@ LEFT JOIN (
|
||||||
sum(read) AS read_count,
|
sum(read) AS read_count,
|
||||||
sum(bookmark) AS bookmark_count
|
sum(bookmark) AS bookmark_count
|
||||||
FROM chapters
|
FROM chapters
|
||||||
LEFT JOIN scanlators_view AS filtered_scanlators
|
LEFT JOIN (
|
||||||
|
WITH split(seq, _id, name, str) AS (
|
||||||
|
SELECT 0, mangas._id, NULL, replace(ifnull(mangas.filtered_scanlators, ''), ' & ', ',')||',' FROM mangas
|
||||||
|
UNION ALL SELECT
|
||||||
|
seq+1,
|
||||||
|
_id,
|
||||||
|
substr(str, 0, instr(str, ',')),
|
||||||
|
substr(str, instr(str, ',')+1)
|
||||||
|
FROM split WHERE str != ''
|
||||||
|
) SELECT _id, name FROM split WHERE split.seq != 0 ORDER BY split.seq ASC
|
||||||
|
) AS filtered_scanlators
|
||||||
ON chapters.manga_id = filtered_scanlators._id
|
ON chapters.manga_id = filtered_scanlators._id
|
||||||
AND ifnull(chapters.scanlator, 'N/A') = ifnull(filtered_scanlators.name, '/<INVALID>/') -- I assume if it's N/A it shouldn't be filtered
|
AND ifnull(chapters.scanlator, 'N/A') = ifnull(filtered_scanlators.name, '/<INVALID>/') -- I assume if it's N/A it shouldn't be filtered
|
||||||
WHERE filtered_scanlators.name IS NULL
|
WHERE filtered_scanlators.name IS NULL
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
CREATE VIEW scanlators_view AS -- Probably should migrate these to a real table
|
|
||||||
WITH split(seq, _id, name, str) AS (
|
|
||||||
SELECT 0, M._id, NULL, replace(ifnull(M.filtered_scanlators, ''), ' & ', ',')||',' FROM mangas AS M
|
|
||||||
UNION ALL SELECT
|
|
||||||
seq+1,
|
|
||||||
_id,
|
|
||||||
substr(str, 0, instr(str, ',')),
|
|
||||||
substr(str, instr(str, ',')+1)
|
|
||||||
FROM split WHERE str != ''
|
|
||||||
) SELECT _id, name FROM split WHERE split.seq != 0 ORDER BY split.seq ASC;
|
|
Loading…
Add table
Add a link
Reference in a new issue