Readded chapters do not notify. Fix #188
This commit is contained in:
parent
ae9c412b6d
commit
e1a3ab2726
@ -260,6 +260,7 @@ public class DatabaseHelper {
|
|||||||
return Observable.zip(newChapters, deletedChapters, (toAdd, toDelete) -> {
|
return Observable.zip(newChapters, deletedChapters, (toAdd, toDelete) -> {
|
||||||
int added = 0;
|
int added = 0;
|
||||||
int deleted = 0;
|
int deleted = 0;
|
||||||
|
int readded = 0;
|
||||||
db.internal().beginTransaction();
|
db.internal().beginTransaction();
|
||||||
try {
|
try {
|
||||||
TreeSet<Float> deletedReadChapterNumbers = new TreeSet<>();
|
TreeSet<Float> deletedReadChapterNumbers = new TreeSet<>();
|
||||||
@ -283,6 +284,7 @@ public class DatabaseHelper {
|
|||||||
// Try to mark already read chapters as read when the source deletes them
|
// Try to mark already read chapters as read when the source deletes them
|
||||||
if (c.chapter_number != -1 && deletedReadChapterNumbers.contains(c.chapter_number)) {
|
if (c.chapter_number != -1 && deletedReadChapterNumbers.contains(c.chapter_number)) {
|
||||||
c.read = true;
|
c.read = true;
|
||||||
|
readded++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
added = insertChapters(toAdd).executeAsBlocking().numberOfInserts();
|
added = insertChapters(toAdd).executeAsBlocking().numberOfInserts();
|
||||||
@ -292,7 +294,7 @@ public class DatabaseHelper {
|
|||||||
} finally {
|
} finally {
|
||||||
db.internal().endTransaction();
|
db.internal().endTransaction();
|
||||||
}
|
}
|
||||||
return Pair.create(added, deleted);
|
return Pair.create(added - readded, deleted - readded);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user