mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +00:00
fix(history): Remove unnecessary JOIN statement
This commit is contained in:
parent
4fc18b4913
commit
301acb9f4d
1 changed files with 3 additions and 5 deletions
|
@ -169,12 +169,10 @@ SELECT
|
||||||
FROM mangas AS M
|
FROM mangas AS M
|
||||||
JOIN chapters AS C
|
JOIN chapters AS C
|
||||||
ON M._id = C.manga_id
|
ON M._id = C.manga_id
|
||||||
JOIN history
|
|
||||||
ON C._id = history.history_chapter_id
|
|
||||||
JOIN (
|
JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
C2.manga_id,
|
C2.manga_id,
|
||||||
C2._id AS history_chapter_id,
|
C2._id,
|
||||||
max(date_upload)
|
max(date_upload)
|
||||||
FROM chapters AS C2 JOIN mangas AS M2
|
FROM chapters AS C2 JOIN mangas AS M2
|
||||||
ON M2._id = C2.manga_id
|
ON M2._id = C2.manga_id
|
||||||
|
@ -186,8 +184,8 @@ LEFT JOIN scanlators_view AS S
|
||||||
ON C.manga_id = S.manga_id
|
ON C.manga_id = S.manga_id
|
||||||
AND C.scanlator = S.name
|
AND C.scanlator = S.name
|
||||||
WHERE favorite = 1
|
WHERE favorite = 1
|
||||||
AND newest_chapter.history_chapter_id = history.history_chapter_id
|
AND C._id = newest_chapter._id
|
||||||
AND date_fetch > date_added
|
AND C.date_fetch > M.date_added
|
||||||
AND lower(title) LIKE '%' || :search || '%'
|
AND lower(title) LIKE '%' || :search || '%'
|
||||||
AND (
|
AND (
|
||||||
:apply_filter = 0 OR S.name IS NULL
|
:apply_filter = 0 OR S.name IS NULL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue