From fdc85bd314a4888efa9f51c3fbc8fa590517653d Mon Sep 17 00:00:00 2001 From: KaiserBh Date: Thu, 3 Aug 2023 15:42:10 +1000 Subject: [PATCH] bugfix: Since syncing is cross-device we need to take read status from backup. I fixed this before but I believe it slipped past while refactoring and splitting into smaller PR, This fixes the unread chapter so if a device have unread chapters or user marked it as unread it should restore it properly now. Signed-off-by: KaiserBh --- .../java/eu/kanade/tachiyomi/data/backup/BackupManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt index 9c699f5353..2e615566ba 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt @@ -454,8 +454,8 @@ class BackupManager( 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) }