From e1a3ab2726338844af8336baacb7936109f3e041 Mon Sep 17 00:00:00 2001 From: len Date: Wed, 2 Mar 2016 14:18:50 +0100 Subject: [PATCH] Readded chapters do not notify. Fix #188 --- .../eu/kanade/tachiyomi/data/database/DatabaseHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/DatabaseHelper.java b/app/src/main/java/eu/kanade/tachiyomi/data/database/DatabaseHelper.java index 36b41a754..0be54b2d2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/DatabaseHelper.java +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/DatabaseHelper.java @@ -260,6 +260,7 @@ public class DatabaseHelper { return Observable.zip(newChapters, deletedChapters, (toAdd, toDelete) -> { int added = 0; int deleted = 0; + int readded = 0; db.internal().beginTransaction(); try { TreeSet deletedReadChapterNumbers = new TreeSet<>(); @@ -283,6 +284,7 @@ public class DatabaseHelper { // Try to mark already read chapters as read when the source deletes them if (c.chapter_number != -1 && deletedReadChapterNumbers.contains(c.chapter_number)) { c.read = true; + readded++; } } added = insertChapters(toAdd).executeAsBlocking().numberOfInserts(); @@ -292,7 +294,7 @@ public class DatabaseHelper { } finally { db.internal().endTransaction(); } - return Pair.create(added, deleted); + return Pair.create(added - readded, deleted - readded); }); }