pull/2437/head
kunfei 2 years ago
parent ccbf610509
commit e947ccab31
  1. 5
      app/src/main/java/io/legado/app/help/source/BookSourceExtensions.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/search/SearchScopeDialog.kt

@ -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)

Loading…
Cancel
Save