Utilize tracker for library duplicate detection (#2978)

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
NarwhalHorns
2026-02-21 10:26:36 +00:00
committed by GitHub
parent 3c6f0f1697
commit 89bbdb17fb
2 changed files with 15 additions and 3 deletions
@@ -118,12 +118,23 @@ AND source = :sourceId;
getDuplicateLibraryManga:
WITH
track_dupes AS (
SELECT S2.manga_id
FROM manga_sync S1
INNER JOIN manga_sync S2
ON S1.sync_id = S2.sync_id
AND S1.remote_id = S2.remote_id
AND S1.manga_id != S2.manga_id
WHERE S1.manga_id = :id
),
duplicates AS (
SELECT *
FROM mangas
SELECT M.*
FROM mangas M
LEFT JOIN track_dupes D
ON D.manga_id = _id
WHERE favorite = 1
AND _id != :id
AND lower(title) LIKE '%' || lower(:title) || '%'
AND (lower(title) LIKE '%' || lower(:title) || '%' OR D.manga_id IS NOT NULL)
),
chapter_counts AS (
SELECT