mirror of
https://github.com/mihonapp/mihon.git
synced 2025-07-08 00:44:30 +02:00
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 <kaiserbh@proton.me>
This commit is contained in:
@ -292,8 +292,8 @@ class BackupRestorer(
|
|||||||
if (dbChapter != null) {
|
if (dbChapter != null) {
|
||||||
updatedChapter = updatedChapter.copy(id = dbChapter._id)
|
updatedChapter = updatedChapter.copy(id = dbChapter._id)
|
||||||
updatedChapter = updatedChapter.copyFrom(dbChapter)
|
updatedChapter = updatedChapter.copyFrom(dbChapter)
|
||||||
if (dbChapter.read && !updatedChapter.read) {
|
if (dbChapter.read != chapter.read) {
|
||||||
updatedChapter = updatedChapter.copy(read = true, lastPageRead = dbChapter.last_page_read)
|
updatedChapter = updatedChapter.copy(read = chapter.read, lastPageRead = chapter.lastPageRead)
|
||||||
} else if (updatedChapter.lastPageRead == 0L && dbChapter.last_page_read != 0L) {
|
} else if (updatedChapter.lastPageRead == 0L && dbChapter.last_page_read != 0L) {
|
||||||
updatedChapter = updatedChapter.copy(lastPageRead = dbChapter.last_page_read)
|
updatedChapter = updatedChapter.copy(lastPageRead = dbChapter.last_page_read)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user