Maybe fix foreign key error during some backup restores

(cherry picked from commit aca36f962516f04bbbac67c9bf54723a13076c1c)
This commit is contained in:
arkon 2023-11-01 22:52:00 -04:00 committed by Jobobby04
parent 65b085ad23
commit 43c5585f7e

View File

@ -367,7 +367,6 @@ class BackupRestorer(
.copyFrom(dbChapter)
.copy(
id = dbChapter.id,
mangaId = manga.id,
bookmark = updatedChapter.bookmark || dbChapter.bookmark,
)
if (dbChapter.read && !updatedChapter.read) {
@ -382,7 +381,7 @@ class BackupRestorer(
}
}
updatedChapter
updatedChapter.copy(mangaId = manga.id)
}
val (existingChapters, newChapters) = processed.partition { it.id > 0 }