mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
chore: Remove NetworkPrefsMigration
Not needed, I thought PreferenceStore is using dataStore or something different since 1.x do that, apparently not when it's backported to 0.x.
This commit is contained in:
parent
4c66025900
commit
55813429b3
2 changed files with 0 additions and 24 deletions
|
@ -36,5 +36,4 @@ val migrations: ImmutableList<Migration> = persistentListOf(
|
|||
ExtensionInstallerEnumMigration(),
|
||||
CutoutMigration(),
|
||||
RepoJsonMigration(),
|
||||
NetworkPrefsMigration(),
|
||||
)
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
package yokai.core.migration.migrations
|
||||
|
||||
import androidx.preference.PreferenceManager
|
||||
import eu.kanade.tachiyomi.App
|
||||
import eu.kanade.tachiyomi.network.NetworkPreferences
|
||||
import yokai.core.migration.Migration
|
||||
import yokai.core.migration.MigrationContext
|
||||
|
||||
class NetworkPrefsMigration : Migration {
|
||||
override val version: Float = 138f
|
||||
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context: App = migrationContext.get() ?: return false
|
||||
val preferences: NetworkPreferences = migrationContext.get() ?: return false
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
|
||||
val dohProvider = prefs.getInt("doh_provider", -1)
|
||||
if (dohProvider > -1) {
|
||||
preferences.dohProvider().set(dohProvider)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue