mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-26 23:18:17 +03:00
more migrations for player prefs
This commit is contained in:
parent
efee413ecb
commit
505a6f5639
2 changed files with 22 additions and 1 deletions
|
@ -28,7 +28,7 @@ android {
|
|||
applicationId = "xyz.jmir.tachiyomi.mi"
|
||||
minSdk = AndroidConfig.minSdk
|
||||
targetSdk = AndroidConfig.targetSdk
|
||||
versionCode = 92
|
||||
versionCode = 93
|
||||
versionName = "0.14.2.0"
|
||||
|
||||
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
||||
|
|
|
@ -380,6 +380,27 @@ object Migrations {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (oldVersion < 93) {
|
||||
listOf(
|
||||
playerPreferences.defaultPlayerOrientationType(),
|
||||
playerPreferences.defaultPlayerOrientationLandscape(),
|
||||
playerPreferences.defaultPlayerOrientationPortrait(),
|
||||
playerPreferences.skipLengthPreference(),
|
||||
).forEach { pref ->
|
||||
if (pref.isSet()) {
|
||||
prefs.edit {
|
||||
val oldString = try {
|
||||
prefs.getString(pref.key(), null)
|
||||
} catch (e: ClassCastException) {
|
||||
null
|
||||
} ?: return@edit
|
||||
val newInt = oldString.toIntOrNull() ?: return@edit
|
||||
putInt(pref.key(), newInt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue