This commit is contained in:
kunfei
2022-10-15 22:50:51 +08:00
parent 8e9afa326f
commit ccbf610509
2 changed files with 9 additions and 1 deletions

View File

@@ -75,4 +75,11 @@ suspend fun BookSource.clearExploreKindsCache() {
aCache.remove(exploreKindsKey)
exploreKindsMap.remove(getExploreKindsKey())
}
}
fun BookSource.contains(word: String): Boolean {
return bookSourceName.contains(word)
|| bookSourceUrl.contains(word)
|| bookSourceGroup?.contains(word) == true
|| bookSourceComment?.contains(word) == true
}

View File

@@ -14,6 +14,7 @@ import io.legado.app.data.entities.BookSource
import io.legado.app.databinding.DialogSearchScopeBinding
import io.legado.app.databinding.ItemCheckBoxBinding
import io.legado.app.databinding.ItemRadioButtonBinding
import io.legado.app.help.source.contains
import io.legado.app.lib.theme.primaryColor
import io.legado.app.utils.applyTint
import io.legado.app.utils.setLayout
@@ -117,7 +118,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
if (binding.rbSource.isChecked) {
sources.filter { source ->
screenText?.let { screenText ->
source.bookSourceName.contains(screenText)
source.contains(screenText)
} ?: true
}.let {
screenSources.clear()