From 4a5bceb4e49962f0498e69f5200800063d575444 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 20 Mar 2021 10:03:13 -0400 Subject: [PATCH] Fix offline restore ignoring manga from not installed sources (fixes #4679) --- .../tachiyomi/data/backup/full/FullBackupRestore.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt index f2fea79b56..8e0dd54085 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt @@ -44,6 +44,8 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier) : AbstractBa restoreManga(it, backup.backupCategories) } + // TODO: optionally trigger online library + tracker update + return true } @@ -63,16 +65,10 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier) : AbstractBa val history = backupManga.history val tracks = backupManga.getTrackingImpl() - val source = backupManager.sourceManager.get(manga.source) - val sourceName = sourceMapping[manga.source] ?: manga.source.toString() - try { - if (source != null) { - restoreMangaData(manga, chapters, categories, history, tracks, backupCategories) - } else { - errors.add(Date() to "${manga.title} [$sourceName]: ${context.getString(R.string.source_not_found_name, sourceName)}") - } + restoreMangaData(manga, chapters, categories, history, tracks, backupCategories) } catch (e: Exception) { + val sourceName = sourceMapping[manga.source] ?: manga.source.toString() errors.add(Date() to "${manga.title} [$sourceName]: ${e.message}") }