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 categories = backupManga.categories
val history = backupManga.history val history = backupManga.history
val tracks = backupManga.getTrackingImpl() val tracks = backupManga.getTrackingImpl()
val customManga = backupManga.getCustomMangaInfo(manga) val customManga = backupManga.getCustomMangaInfo()
try { try {
restoreMangaData(manga, chapters, categories, history, tracks, backupCategories, customManga) 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 || if (customTitle != null ||
customArtist != null || customArtist != null ||
customAuthor != null || customAuthor != null ||
customDescription != null || customDescription != null ||
customGenre != null || customGenre != null ||
manga.status != customStatus customStatus != 0
) { ) {
return CustomMangaManager.MangaJson( return CustomMangaManager.MangaJson(
id = 0L, id = 0L,
@ -85,7 +85,7 @@ data class BackupManga(
artist = customArtist, artist = customArtist,
description = customDescription, description = customDescription,
genre = customGenre?.toTypedArray(), genre = customGenre?.toTypedArray(),
status = if (manga.status != customStatus) customStatus else null status = customStatus.takeUnless { it == 0 }
) )
} }
return null return null