mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 06:42:07 +01:00
Restore server settings first (#1637)
The imported server settings might cause the active database to change. In case this happens, the backup was restored into the wrong database.
This commit is contained in:
@@ -197,23 +197,23 @@ object ProtoBackupImport : ProtoBackupBase() {
|
||||
val getRestoreAmount = { size: Int -> size + restoreCategories + restoreMeta + restoreSettings }
|
||||
val restoreAmount = getRestoreAmount(backup.backupManga.size)
|
||||
|
||||
updateRestoreState(id, BackupRestoreState.RestoringCategories(restoreCategories, restoreAmount))
|
||||
updateRestoreState(
|
||||
id,
|
||||
BackupRestoreState.RestoringSettings(restoreSettings, restoreAmount),
|
||||
)
|
||||
|
||||
BackupSettingsHandler.restore(backup.serverSettings)
|
||||
|
||||
updateRestoreState(id, BackupRestoreState.RestoringCategories(restoreSettings + restoreCategories, restoreAmount))
|
||||
|
||||
val categoryMapping = restoreCategories(backup.backupCategories)
|
||||
|
||||
updateRestoreState(id, BackupRestoreState.RestoringMeta(restoreCategories + restoreMeta, restoreAmount))
|
||||
updateRestoreState(id, BackupRestoreState.RestoringMeta(restoreSettings + restoreCategories + restoreMeta, restoreAmount))
|
||||
|
||||
restoreGlobalMeta(backup.meta)
|
||||
|
||||
restoreSourceMeta(backup.backupSources)
|
||||
|
||||
updateRestoreState(
|
||||
id,
|
||||
BackupRestoreState.RestoringSettings(restoreCategories + restoreMeta + restoreSettings, restoreAmount),
|
||||
)
|
||||
|
||||
BackupSettingsHandler.restore(backup.serverSettings)
|
||||
|
||||
// Store source mapping for error messages
|
||||
val sourceMapping = backup.getSourceMap()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user