Skip to content

Commit

Permalink
Allow Backing up only Extension Repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Animeboynz committed Jul 28, 2024
1 parent b836305 commit c90fdf4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ data class BackupOptions(
privateSettings,
)

fun anyEnabled() = libraryEntries || appSettings || sourceSettings
fun anyEnabled() = libraryEntries || appSettings || sourceSettings || extensionRepoSettings

companion object {
val libraryOptions = persistentListOf(
Expand Down Expand Up @@ -87,6 +87,13 @@ data class BackupOptions(
),
)

/*
* I initially forgot to add extensionRepoSettings here
* but it was still working so no clue what this is really for
* and hopefully shifting the index does not cause any issues.
* Currently too tired to look at code and see what this
* function really does.
*/
fun fromBooleanArray(array: BooleanArray) = BackupOptions(
libraryEntries = array[0],
categories = array[1],
Expand All @@ -95,7 +102,8 @@ data class BackupOptions(
history = array[4],
appSettings = array[5],
sourceSettings = array[6],
privateSettings = array[7],
extensionRepoSettings = array[7],
privateSettings = array[8],
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ package eu.kanade.tachiyomi.data.backup.models
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber

/*
* The @Suppress("MagicNumber") was only being triggered for num 106
* but no clue why. Just a quick note to self to come back to this.
*/
@Suppress("MagicNumber")
@Serializable
data class Backup(
@ProtoNumber(1) val backupManga: List<BackupManga>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import tachiyomi.data.DatabaseHandler
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get


class ExtensionRepoRestorer(
private val handler: DatabaseHandler = Injekt.get(),
private val getExtensionRepos: GetExtensionRepo = Injekt.get()
Expand Down

0 comments on commit c90fdf4

Please sign in to comment.