Utilize tracker for library duplicate detection (#2978)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
@@ -25,6 +25,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
|
|||||||
- Reword download reindexing message to avoid confusion ([@MajorTanya](https://github.com/MajorTanya)) ([#2874](https://github.com/mihonapp/mihon/pull/2874))
|
- Reword download reindexing message to avoid confusion ([@MajorTanya](https://github.com/MajorTanya)) ([#2874](https://github.com/mihonapp/mihon/pull/2874))
|
||||||
- Rework internals for better performance ([@Lolle2000la](https://github.com/Lolle2000la)) ([#2955](https://github.com/mihonapp/mihon/pull/2955))
|
- Rework internals for better performance ([@Lolle2000la](https://github.com/Lolle2000la)) ([#2955](https://github.com/mihonapp/mihon/pull/2955))
|
||||||
- Optimize tracked library filter ([@NarwhalHorns](https://github.com/NarwhalHorns)) ([#2977](https://github.com/mihonapp/mihon/pull/2977))
|
- Optimize tracked library filter ([@NarwhalHorns](https://github.com/NarwhalHorns)) ([#2977](https://github.com/mihonapp/mihon/pull/2977))
|
||||||
|
- Utilize tracker for library duplicate detection ([@NarwhalHorns](https://github.com/NarwhalHorns)) ([#2977](https://github.com/mihonapp/mihon/pull/2978))
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Update tracker icons ([@AntsyLich](https://github.com/AntsyLich)) ([#2773](https://github.com/mihonapp/mihon/pull/2773))
|
- Update tracker icons ([@AntsyLich](https://github.com/AntsyLich)) ([#2773](https://github.com/mihonapp/mihon/pull/2773))
|
||||||
|
|||||||
@@ -118,12 +118,23 @@ AND source = :sourceId;
|
|||||||
|
|
||||||
getDuplicateLibraryManga:
|
getDuplicateLibraryManga:
|
||||||
WITH
|
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 (
|
duplicates AS (
|
||||||
SELECT *
|
SELECT M.*
|
||||||
FROM mangas
|
FROM mangas M
|
||||||
|
LEFT JOIN track_dupes D
|
||||||
|
ON D.manga_id = _id
|
||||||
WHERE favorite = 1
|
WHERE favorite = 1
|
||||||
AND _id != :id
|
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 (
|
chapter_counts AS (
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Reference in New Issue
Block a user