pull/2437/head
kunfei 3 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) return bookSourceName.contains(word)
|| bookSourceUrl.contains(word) || bookSourceUrl.contains(word)
|| bookSourceGroup?.contains(word) == true || bookSourceGroup?.contains(word) == true

@ -117,9 +117,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
withContext(IO) { withContext(IO) {
if (binding.rbSource.isChecked) { if (binding.rbSource.isChecked) {
sources.filter { source -> sources.filter { source ->
screenText?.let { screenText -> source.contains(screenText)
source.contains(screenText)
} ?: true
}.let { }.let {
screenSources.clear() screenSources.clear()
screenSources.addAll(it) screenSources.addAll(it)

Loading…
Cancel
Save