diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt index 3ef70d6530..8166a1f97e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt @@ -8,7 +8,6 @@ import eu.kanade.tachiyomi.data.backup.create.BackupOptions import eu.kanade.tachiyomi.data.backup.models.Backup import eu.kanade.tachiyomi.data.backup.models.BackupChapter import eu.kanade.tachiyomi.data.backup.models.BackupManga -import eu.kanade.tachiyomi.data.backup.models.BackupSerializer import eu.kanade.tachiyomi.data.backup.restore.BackupRestoreJob import eu.kanade.tachiyomi.data.backup.restore.RestoreOptions import eu.kanade.tachiyomi.data.backup.restore.restorers.MangaRestorer @@ -202,7 +201,7 @@ class SyncManager( val cacheFile = File(context.cacheDir, "tachiyomi_sync_data.proto.gz") return try { cacheFile.outputStream().use { output -> - output.write(ProtoBuf.encodeToByteArray(BackupSerializer, backup)) + output.write(ProtoBuf.encodeToByteArray(Backup.serializer(), backup)) Uri.fromFile(cacheFile) } } catch (e: IOException) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt index 2af4d28ffe..e0b2f7fe7e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt @@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.data.sync.service import android.content.Context import eu.kanade.domain.sync.SyncPreferences import eu.kanade.tachiyomi.data.backup.models.Backup -import eu.kanade.tachiyomi.data.backup.models.BackupSerializer import eu.kanade.tachiyomi.data.sync.SyncNotifier import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.PUT @@ -104,7 +103,7 @@ class SyncYomiSyncService( } return try { - val backup = protoBuf.decodeFromByteArray(BackupSerializer, byteArray) + val backup = ProtoBuf.decodeFromByteArray(Backup.serializer(), byteArray) return Pair(SyncData(backup = backup), newETag) } catch (_: SerializationException) { logcat(LogPriority.INFO) { @@ -147,7 +146,7 @@ class SyncYomiSyncService( .writeTimeout(timeout, TimeUnit.SECONDS) .build() - val byteArray = protoBuf.encodeToByteArray(BackupSerializer, backup) + val byteArray = ProtoBuf.encodeToByteArray(Backup.serializer(), backup) if (byteArray.isEmpty()) { throw IllegalStateException(context.stringResource(MR.strings.empty_backup_error)) }