fix(history): Remove unnecessary JOIN statement

This commit is contained in:
Ahmad Ansori Palembani 2024-12-16 09:12:49 +07:00
parent 4fc18b4913
commit 301acb9f4d
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -169,12 +169,10 @@ SELECT
FROM mangas AS M
JOIN chapters AS C
ON M._id = C.manga_id
JOIN history
ON C._id = history.history_chapter_id
JOIN (
SELECT
C2.manga_id,
C2._id AS history_chapter_id,
C2._id,
max(date_upload)
FROM chapters AS C2 JOIN mangas AS M2
ON M2._id = C2.manga_id
@ -186,8 +184,8 @@ LEFT JOIN scanlators_view AS S
ON C.manga_id = S.manga_id
AND C.scanlator = S.name
WHERE favorite = 1
AND newest_chapter.history_chapter_id = history.history_chapter_id
AND date_fetch > date_added
AND C._id = newest_chapter._id
AND C.date_fetch > M.date_added
AND lower(title) LIKE '%' || :search || '%'
AND (
:apply_filter = 0 OR S.name IS NULL