allow search source using both source's name & extensions's name
This commit is contained in:
parent
20e3b1284f
commit
a3e47a1055
1 changed files with 2 additions and 1 deletions
|
|
@ -108,12 +108,13 @@ class SourcesScreenModel(
|
|||
// KMK -->
|
||||
val queryFilter: (String?) -> ((Source) -> Boolean) = { query ->
|
||||
filter@{ source ->
|
||||
if (nsfwOnly && source.installedExtension != null && !source.installedExtension!!.isNsfw) return@filter false
|
||||
if (nsfwOnly && source.installedExtension?.isNsfw == true) return@filter false
|
||||
if (query.isNullOrBlank()) return@filter true
|
||||
query.split(",").any {
|
||||
val input = it.trim()
|
||||
if (input.isEmpty()) return@any false
|
||||
source.name.contains(input, ignoreCase = true) ||
|
||||
source.installedExtension?.name?.contains(input, ignoreCase = true) == true ||
|
||||
source.id == input.toLongOrNull()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue