diff --git a/data/src/main/sqldelight/tachiyomi/migrations/37.sqm b/data/src/main/sqldelight/tachiyomi/migrations/37.sqm index cc58a5d90..b8d67cce1 100644 --- a/data/src/main/sqldelight/tachiyomi/migrations/37.sqm +++ b/data/src/main/sqldelight/tachiyomi/migrations/37.sqm @@ -97,7 +97,11 @@ SELECT chapters.date_fetch AS datefetch FROM mangas JOIN chapters ON mangas._id = chapters.manga_id +LEFT JOIN excluded_scanlators +ON mangas._id = excluded_scanlators.manga_id +AND chapters.scanlator = excluded_scanlators.scanlator WHERE favorite = 1 AND source <> 6969 +AND excluded_scanlators.scanlator IS NULL AND date_fetch > date_added UNION SELECT @@ -124,6 +128,10 @@ LEFT JOIN ( ON ME.merge_id = mangas._id JOIN chapters ON ME.manga_id = chapters.manga_id +LEFT JOIN excluded_scanlators +ON mangas._id = excluded_scanlators.manga_id +AND chapters.scanlator = excluded_scanlators.scanlator WHERE favorite = 1 AND source = 6969 +AND excluded_scanlators.scanlator IS NULL AND date_fetch > date_added -ORDER BY datefetch DESC; \ No newline at end of file +ORDER BY datefetch DESC; diff --git a/data/src/main/sqldelight/tachiyomi/view/updatesView.sq b/data/src/main/sqldelight/tachiyomi/view/updatesView.sq index 78c17f93a..9829c6065 100644 --- a/data/src/main/sqldelight/tachiyomi/view/updatesView.sq +++ b/data/src/main/sqldelight/tachiyomi/view/updatesView.sq @@ -17,7 +17,11 @@ SELECT chapters.date_fetch AS datefetch FROM mangas JOIN chapters ON mangas._id = chapters.manga_id +LEFT JOIN excluded_scanlators +ON mangas._id = excluded_scanlators.manga_id +AND chapters.scanlator = excluded_scanlators.scanlator WHERE favorite = 1 AND source <> 6969 +AND excluded_scanlators.scanlator IS NULL AND date_fetch > date_added UNION SELECT @@ -44,7 +48,11 @@ LEFT JOIN ( ON ME.merge_id = mangas._id JOIN chapters ON ME.manga_id = chapters.manga_id +LEFT JOIN excluded_scanlators +ON mangas._id = excluded_scanlators.manga_id +AND chapters.scanlator = excluded_scanlators.scanlator WHERE favorite = 1 AND source = 6969 +AND excluded_scanlators.scanlator IS NULL AND date_fetch > date_added ORDER BY datefetch DESC;