mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Fix embarrassing crash when using different languages in library
This commit is contained in:
parent
4a0989c9c5
commit
f6c609cfdf
1 changed files with 7 additions and 7 deletions
|
@ -152,13 +152,13 @@ class LibraryFragment : Fragment() {
|
||||||
(APIHolder.getApiFromNameNull(apiName)?.let { listOf(it.name) } ?: emptyList())
|
(APIHolder.getApiFromNameNull(apiName)?.let { listOf(it.name) } ?: emptyList())
|
||||||
|
|
||||||
val baseOptions = listOf(
|
val baseOptions = listOf(
|
||||||
txt(LibraryOpenerType.Default.stringRes).asString(this),
|
LibraryOpenerType.Default,
|
||||||
txt(LibraryOpenerType.None.stringRes).asString(this),
|
LibraryOpenerType.None,
|
||||||
txt(LibraryOpenerType.Browser.stringRes).asString(this),
|
LibraryOpenerType.Browser,
|
||||||
txt(LibraryOpenerType.Search.stringRes).asString(this),
|
LibraryOpenerType.Search
|
||||||
)
|
)
|
||||||
|
|
||||||
val items = baseOptions + availableProviders
|
val items = baseOptions.map { txt(it.stringRes).asString(this) } + availableProviders
|
||||||
|
|
||||||
val savedSelection = getKey<LibraryOpener>(LIBRARY_FOLDER, key)
|
val savedSelection = getKey<LibraryOpener>(LIBRARY_FOLDER, key)
|
||||||
val selectedIndex =
|
val selectedIndex =
|
||||||
|
@ -172,7 +172,7 @@ class LibraryFragment : Fragment() {
|
||||||
?.plus(baseOptions.size) ?: 0
|
?.plus(baseOptions.size) ?: 0
|
||||||
}
|
}
|
||||||
// Else base option
|
// Else base option
|
||||||
else -> baseOptions.indexOf(savedSelection.openType.name)
|
else -> baseOptions.indexOf(savedSelection.openType)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.showBottomDialog(
|
this.showBottomDialog(
|
||||||
|
@ -184,7 +184,7 @@ class LibraryFragment : Fragment() {
|
||||||
) {
|
) {
|
||||||
val savedData = if (it < baseOptions.size) {
|
val savedData = if (it < baseOptions.size) {
|
||||||
LibraryOpener(
|
LibraryOpener(
|
||||||
LibraryOpenerType.valueOf(baseOptions[it]),
|
baseOptions[it],
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue