mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fixes
This commit is contained in:
parent
58d34b8294
commit
5516c8c32d
1 changed files with 18 additions and 21 deletions
|
@ -315,31 +315,28 @@ class SearchFragment : Fragment() {
|
|||
arrayAdapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
val selectedSearchTypesFromDialog = DataStoreHelper.searchPreferenceTags
|
||||
|
||||
context?.filterProviderByPreferredMedia()?.let { validAPIs ->
|
||||
bindChips(
|
||||
selectMainpageBinding.tvtypesChipsScroll.tvtypesChips,
|
||||
selectedSearchTypesFromDialog,
|
||||
validAPIs.flatMap { api -> api.supportedTypes }.distinct()
|
||||
) { list ->
|
||||
updateList(list)
|
||||
|
||||
// refresh selected chips in main chips
|
||||
if (selectedSearchTypes.toSet() != list.toSet()) {
|
||||
selectedSearchTypes.clear()
|
||||
selectedSearchTypes.addAll(list)
|
||||
bindChips(
|
||||
binding?.tvtypesChipsScroll?.tvtypesChips,
|
||||
selectedSearchTypes,
|
||||
validAPIs.flatMap { api -> api.supportedTypes }.distinct()
|
||||
) { // This already handled in another bindChips. Do nothing here! }
|
||||
}
|
||||
bindChips(
|
||||
selectMainpageBinding.tvtypesChipsScroll.tvtypesChips,
|
||||
selectedSearchTypes,
|
||||
validAPIs.flatMap { api -> api.supportedTypes }.distinct()
|
||||
) { list ->
|
||||
updateList(list)
|
||||
|
||||
// refresh selected chips in main chips
|
||||
if (selectedSearchTypes.toSet() != list.toSet()) {
|
||||
selectedSearchTypes.clear()
|
||||
selectedSearchTypes.addAll(list)
|
||||
bindChips(
|
||||
binding?.tvtypesChipsScroll?.tvtypesChips,
|
||||
selectedSearchTypes,
|
||||
validAPIs.flatMap { api -> api.supportedTypes }.distinct()
|
||||
) { // This already handled in another bindChips. Do nothing here! }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cancelBtt?.setOnClickListener {
|
||||
dialog.dismissSafe()
|
||||
}
|
||||
|
@ -362,7 +359,7 @@ class SearchFragment : Fragment() {
|
|||
// run search when dialog is close
|
||||
search(binding?.mainSearch?.query?.toString())
|
||||
}
|
||||
updateList(selectedSearchTypesFromDialog.toList())
|
||||
updateList(selectedSearchTypes.toList())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue