Skip to content

Commit

Permalink
Fix backups
Browse files Browse the repository at this point in the history
  • Loading branch information
AntsyLich authored and nonproto committed Aug 23, 2024
1 parent 509f2b8 commit 4c15f75
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
minSdk = AndroidConfig.minSdkVersion
targetSdk = AndroidConfig.targetSdkVersion
applicationId = "org.nekomanga.neko"
versionCode = 12
versionName = "2.17.0"
versionCode = 13
versionName = "2.17.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
setProperty("archivesBaseName", "Neko")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import eu.kanade.tachiyomi.data.backup.models.BackupChapter
import eu.kanade.tachiyomi.data.backup.models.BackupHistory
import eu.kanade.tachiyomi.data.backup.models.BackupManga
import eu.kanade.tachiyomi.data.backup.models.BackupMergeManga
import eu.kanade.tachiyomi.data.backup.models.BackupSerializer
import eu.kanade.tachiyomi.data.backup.models.BackupTracking
import eu.kanade.tachiyomi.data.database.DatabaseHelper
import eu.kanade.tachiyomi.data.database.models.Manga
Expand Down Expand Up @@ -100,7 +99,7 @@ class BackupCreator(val context: Context) {
throw IllegalStateException("Failed to get handle on file")
}

val byteArray = parser.encodeToByteArray(BackupSerializer, backup!!)
val byteArray = parser.encodeToByteArray(Backup.serializer(), backup!!)
if (byteArray.isEmpty()) {
throw IllegalStateException(context.getString(R.string.empty_backup_error))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.data.backup

import android.content.Context
import android.net.Uri
import eu.kanade.tachiyomi.data.backup.models.BackupSerializer
import eu.kanade.tachiyomi.data.backup.models.Backup
import eu.kanade.tachiyomi.data.track.TrackManager
import okio.buffer
import okio.gzip
Expand Down Expand Up @@ -30,7 +30,7 @@ class BackupFileValidator(
context.contentResolver.openInputStream(uri)!!.source().gzip().buffer().use {
it.readByteArray()
}
backupManager.parser.decodeFromByteArray(BackupSerializer, backupString)
backupManager.parser.decodeFromByteArray(Backup.serializer(), backupString)
} catch (e: Exception) {
throw IllegalStateException(e)
}
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions app/src/main/java/eu/kanade/tachiyomi/util/BackupUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.content.Context
import android.net.Uri
import eu.kanade.tachiyomi.data.backup.BackupCreator
import eu.kanade.tachiyomi.data.backup.models.Backup
import eu.kanade.tachiyomi.data.backup.models.BackupSerializer
import okio.buffer
import okio.gzip
import okio.source
Expand All @@ -29,6 +28,6 @@ object BackupUtil {
}
.use { it.readByteArray() }

return backupCreator.parser.decodeFromByteArray(BackupSerializer, backupString)
return backupCreator.parser.decodeFromByteArray(Backup.serializer(), backupString)
}
}

0 comments on commit 4c15f75

Please sign in to comment.