Fix crash when setting empty image cache size or seek increments
This commit is contained in:
parent
1f56408c14
commit
385f097beb
2 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ class GlideModule : AppGlideModule() {
|
|||
val use = preferences.getBoolean(Constants.PREF_IMAGE_CACHE, true)
|
||||
|
||||
if (use) {
|
||||
val sizeMb = preferences.getString(Constants.PREF_IMAGE_CACHE_SIZE, "${Constants.DEFAULT_CACHE_SIZE}")?.toInt()!!
|
||||
val sizeMb = preferences.getString(Constants.PREF_IMAGE_CACHE_SIZE, Constants.DEFAULT_CACHE_SIZE.toString())!!.toIntOrNull() ?: Constants.DEFAULT_CACHE_SIZE
|
||||
val sizeB = 1024L * 1024 * sizeMb
|
||||
Timber.d("Setting image cache to use $sizeMb MB of disk space")
|
||||
|
||||
|
|
|
@ -37,10 +37,10 @@ constructor(
|
|||
val playerSeekBackIncrement = sharedPreferences.getString(
|
||||
Constants.PREF_PLAYER_SEEK_BACK_INC,
|
||||
DEFAULT_SEEK_BACK_INCREMENT_MS.toString()
|
||||
)!!.toLong()
|
||||
)!!.toLongOrNull() ?: DEFAULT_SEEK_BACK_INCREMENT_MS
|
||||
val playerSeekForwardIncrement = sharedPreferences.getString(
|
||||
Constants.PREF_PLAYER_SEEK_FORWARD_INC,
|
||||
DEFAULT_SEEK_FORWARD_INCREMENT_MS.toString()
|
||||
)!!.toLong()
|
||||
)!!.toLongOrNull() ?: DEFAULT_SEEK_FORWARD_INCREMENT_MS
|
||||
val mpvDisableHwDec = sharedPreferences.getBoolean("mpv_disable_hwdec", false)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue