mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-15 23:12:48 +01:00
fix: fix not restoring categories etc.
This commit is contained in:
parent
75b9871e55
commit
877bf721e3
@ -65,8 +65,6 @@ class SyncManager(
|
|||||||
*/
|
*/
|
||||||
suspend fun syncData() {
|
suspend fun syncData() {
|
||||||
val databaseManga = getAllMangaFromDB()
|
val databaseManga = getAllMangaFromDB()
|
||||||
|
|
||||||
logcat(LogPriority.DEBUG) { "Mangas to sync: $databaseManga" }
|
|
||||||
val backup = Backup(
|
val backup = Backup(
|
||||||
backupManager.backupMangas(databaseManga, BACKUP_ALL),
|
backupManager.backupMangas(databaseManga, BACKUP_ALL),
|
||||||
backupManager.backupCategories(BACKUP_ALL),
|
backupManager.backupCategories(BACKUP_ALL),
|
||||||
@ -115,7 +113,12 @@ class SyncManager(
|
|||||||
if (remoteBackup != null) {
|
if (remoteBackup != null) {
|
||||||
val (filteredFavorites, nonFavorites) = filterFavoritesAndNonFavorites(remoteBackup)
|
val (filteredFavorites, nonFavorites) = filterFavoritesAndNonFavorites(remoteBackup)
|
||||||
updateNonFavorites(nonFavorites)
|
updateNonFavorites(nonFavorites)
|
||||||
SyncHolder.backup = backup.copy(backupManga = filteredFavorites)
|
SyncHolder.backup = backup.copy(
|
||||||
|
backupManga = filteredFavorites,
|
||||||
|
backupCategories = remoteBackup.backupCategories,
|
||||||
|
backupSources = remoteBackup.backupSources,
|
||||||
|
backupBrokenSources = remoteBackup.backupBrokenSources,
|
||||||
|
)
|
||||||
BackupRestoreJob.start(context, "".toUri(), true)
|
BackupRestoreJob.start(context, "".toUri(), true)
|
||||||
syncPreferences.syncLastSync().set(Instant.now())
|
syncPreferences.syncLastSync().set(Instant.now())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user