Include source name in backup restore error logs (closes #4230)
(cherry picked from commit 3bb2102eb46af2ae2c03e505ade2512666b5cc91) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/data/backup/legacy/LegacyBackupRestore.kt
This commit is contained in:
parent
7a6a33d5fe
commit
8a8d8f7189
@ -99,16 +99,17 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier, private val
|
|||||||
manga = EXHMigrations.migrateBackupEntry(manga)
|
manga = EXHMigrations.migrateBackupEntry(manga)
|
||||||
// SY <--
|
// SY <--
|
||||||
|
|
||||||
|
val source = backupManager.sourceManager.get(manga.source)
|
||||||
|
val sourceName = sourceMapping[manga.source] ?: manga.source.toString()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val source = backupManager.sourceManager.get(manga.source)
|
|
||||||
if (source != null || !online) {
|
if (source != null || !online) {
|
||||||
restoreMangaData(manga, source, chapters, categories, history, tracks, backupCategories, mergedMangaReferences, flatMetadata, online)
|
restoreMangaData(manga, source, chapters, categories, history, tracks, backupCategories, mergedMangaReferences, flatMetadata, online)
|
||||||
} else {
|
} else {
|
||||||
val sourceName = sourceMapping[manga.source] ?: manga.source.toString()
|
errors.add(Date() to "${manga.title} [$sourceName]: ${context.getString(R.string.source_not_found_name, sourceName)}")
|
||||||
errors.add(Date() to "${manga.title} - ${context.getString(R.string.source_not_found_name, sourceName)}")
|
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
errors.add(Date() to "${manga.title} - ${e.message}")
|
errors.add(Date() to "${manga.title} [$sourceName]: ${e.message}")
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreProgress += 1
|
restoreProgress += 1
|
||||||
|
@ -118,16 +118,17 @@ class LegacyBackupRestore(context: Context, notifier: BackupNotifier) : Abstract
|
|||||||
manga = EXHMigrations.migrateBackupEntry(manga)
|
manga = EXHMigrations.migrateBackupEntry(manga)
|
||||||
// <-- EXH
|
// <-- EXH
|
||||||
|
|
||||||
|
val source = backupManager.sourceManager.get(manga.source)
|
||||||
|
val sourceName = sourceMapping[manga.source] ?: manga.source.toString()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val source = backupManager.sourceManager.get(manga.source)
|
|
||||||
if (source != null) {
|
if (source != null) {
|
||||||
restoreMangaData(manga, source, chapters, categories, history, tracks)
|
restoreMangaData(manga, source, chapters, categories, history, tracks)
|
||||||
} else {
|
} else {
|
||||||
val sourceName = sourceMapping[manga.source] ?: manga.source.toString()
|
errors.add(Date() to "${manga.title} [$sourceName]: ${context.getString(R.string.source_not_found_name, sourceName)}")
|
||||||
errors.add(Date() to "${manga.title} - ${context.getString(R.string.source_not_found_name, sourceName)}")
|
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
errors.add(Date() to "${manga.title} - ${e.message}")
|
errors.add(Date() to "${manga.title} [$sourceName]: ${e.message}")
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreProgress += 1
|
restoreProgress += 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user