mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fix: Edge case bug of setting preferred media without any provider that has mainPage (#231)
This commit is contained in:
parent
f38ffc8ce9
commit
97641d5459
1 changed files with 3 additions and 2 deletions
|
@ -347,8 +347,9 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
||||||
settingsManager.edit()
|
settingsManager.edit()
|
||||||
.putInt(getString(R.string.preferred_media_settings), prefValues[it])
|
.putInt(getString(R.string.preferred_media_settings), prefValues[it])
|
||||||
.apply()
|
.apply()
|
||||||
val apiRandom = AppUtils.filterProviderByPreferredMedia(apis, prefValues[it]).random()
|
val apilist = AppUtils.filterProviderByPreferredMedia(apis, prefValues[it])
|
||||||
context?.setKey(HOMEPAGE_API, apiRandom.name)
|
val apiRandom = if (apilist?.size > 0) { apilist.random().name } else { "" }
|
||||||
|
context?.setKey(HOMEPAGE_API, apiRandom)
|
||||||
context?.initRequestClient()
|
context?.initRequestClient()
|
||||||
}
|
}
|
||||||
return@setOnPreferenceClickListener true
|
return@setOnPreferenceClickListener true
|
||||||
|
|
Loading…
Reference in a new issue