Fix restore adding unknown status to items

This commit is contained in:
Jays2Kings 2021-04-15 04:16:51 -04:00
parent 05558f5733
commit 2c143155d6
2 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier) : AbstractBa
val categories = backupManga.categories
val history = backupManga.history
val tracks = backupManga.getTrackingImpl()
val customManga = backupManga.getCustomMangaInfo(manga)
val customManga = backupManga.getCustomMangaInfo()
try {
restoreMangaData(manga, chapters, categories, history, tracks, backupCategories, customManga)

View File

@ -70,13 +70,13 @@ data class BackupManga(
}
}
fun getCustomMangaInfo(manga: Manga): CustomMangaManager.MangaJson? {
fun getCustomMangaInfo(): CustomMangaManager.MangaJson? {
if (customTitle != null ||
customArtist != null ||
customAuthor != null ||
customDescription != null ||
customGenre != null ||
manga.status != customStatus
customStatus != 0
) {
return CustomMangaManager.MangaJson(
id = 0L,
@ -85,7 +85,7 @@ data class BackupManga(
artist = customArtist,
description = customDescription,
genre = customGenre?.toTypedArray(),
status = if (manga.status != customStatus) customStatus else null
status = customStatus.takeUnless { it == 0 }
)
}
return null