From 6c4f1184cb5e92365b722694355f6f3959735e58 Mon Sep 17 00:00:00 2001 From: KaiserBh Date: Wed, 11 Oct 2023 23:23:34 +1100 Subject: [PATCH] refactor: make sure the read status is taken from backup. This way it will mark chapters as unread if it's not read and vice versa. Signed-off-by: KaiserBh --- .../java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt index c912be3f9..62b68cb60 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt @@ -292,8 +292,8 @@ class BackupRestorer( if (dbChapter != null) { updatedChapter = updatedChapter.copy(id = dbChapter._id) updatedChapter = updatedChapter.copyFrom(dbChapter) - if (dbChapter.read && !updatedChapter.read) { - updatedChapter = updatedChapter.copy(read = true, lastPageRead = dbChapter.last_page_read) + if (dbChapter.read != chapter.read) { + updatedChapter = updatedChapter.copy(read = chapter.read, lastPageRead = chapter.lastPageRead) } else if (updatedChapter.lastPageRead == 0L && dbChapter.last_page_read != 0L) { updatedChapter = updatedChapter.copy(lastPageRead = dbChapter.last_page_read) }