mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -77,7 +77,10 @@ suspend fun BookSource.clearExploreKindsCache() {
|
||||
}
|
||||
}
|
||||
|
||||
fun BookSource.contains(word: String): Boolean {
|
||||
fun BookSource.contains(word: String?): Boolean {
|
||||
if (word.isNullOrEmpty()) {
|
||||
return true
|
||||
}
|
||||
return bookSourceName.contains(word)
|
||||
|| bookSourceUrl.contains(word)
|
||||
|| bookSourceGroup?.contains(word) == true
|
||||
|
||||
@@ -117,9 +117,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
|
||||
withContext(IO) {
|
||||
if (binding.rbSource.isChecked) {
|
||||
sources.filter { source ->
|
||||
screenText?.let { screenText ->
|
||||
source.contains(screenText)
|
||||
} ?: true
|
||||
source.contains(screenText)
|
||||
}.let {
|
||||
screenSources.clear()
|
||||
screenSources.addAll(it)
|
||||
|
||||
Reference in New Issue
Block a user