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:
Ahmad Ansori Palembani 2024-06-23 07:27:06 +07:00
parent 4c66025900
commit 55813429b3
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 0 additions and 24 deletions

View file

@ -36,5 +36,4 @@ val migrations: ImmutableList<Migration> = persistentListOf(
ExtensionInstallerEnumMigration(),
CutoutMigration(),
RepoJsonMigration(),
NetworkPrefsMigration(),
)

View file

@ -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
}
}