mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
Merge pull request #2381 from Bnyro/master
fix crash when restoring the preferences backup
This commit is contained in:
commit
6feb8c1496
@ -5,6 +5,7 @@ import android.net.Uri
|
||||
import androidx.core.content.edit
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import com.github.libretube.constants.PreferenceKeys
|
||||
import com.github.libretube.db.DatabaseHolder.Companion.Database
|
||||
import com.github.libretube.extensions.query
|
||||
import com.github.libretube.obj.BackupFile
|
||||
@ -94,7 +95,12 @@ class BackupHelper(private val context: Context) {
|
||||
is Boolean -> putBoolean(it.key, it.value)
|
||||
is Float -> putFloat(it.key, it.value)
|
||||
is Long -> putLong(it.key, it.value)
|
||||
is Int -> putInt(it.key, it.value)
|
||||
is Int -> {
|
||||
when (it.key) {
|
||||
PreferenceKeys.START_FRAGMENT -> putInt(it.key, it.value)
|
||||
else -> putLong(it.key, it.value.toLong())
|
||||
}
|
||||
}
|
||||
is String -> putString(it.key, it.value)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user