This commit is contained in:
kunfei
2022-10-15 22:50:51 +08:00
parent d27da56e72
commit 90eba87331
2 changed files with 9 additions and 1 deletions
@@ -75,4 +75,11 @@ suspend fun BookSource.clearExploreKindsCache() {
aCache.remove(exploreKindsKey) aCache.remove(exploreKindsKey)
exploreKindsMap.remove(getExploreKindsKey()) exploreKindsMap.remove(getExploreKindsKey())
} }
}
fun BookSource.contains(word: String): Boolean {
return bookSourceName.contains(word)
|| bookSourceUrl.contains(word)
|| bookSourceGroup?.contains(word) == true
|| bookSourceComment?.contains(word) == true
} }
@@ -14,6 +14,7 @@ import io.legado.app.data.entities.BookSource
import io.legado.app.databinding.DialogSearchScopeBinding import io.legado.app.databinding.DialogSearchScopeBinding
import io.legado.app.databinding.ItemCheckBoxBinding import io.legado.app.databinding.ItemCheckBoxBinding
import io.legado.app.databinding.ItemRadioButtonBinding import io.legado.app.databinding.ItemRadioButtonBinding
import io.legado.app.help.source.contains
import io.legado.app.lib.theme.primaryColor import io.legado.app.lib.theme.primaryColor
import io.legado.app.utils.applyTint import io.legado.app.utils.applyTint
import io.legado.app.utils.setLayout import io.legado.app.utils.setLayout
@@ -117,7 +118,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
if (binding.rbSource.isChecked) { if (binding.rbSource.isChecked) {
sources.filter { source -> sources.filter { source ->
screenText?.let { screenText -> screenText?.let { screenText ->
source.bookSourceName.contains(screenText) source.contains(screenText)
} ?: true } ?: true
}.let { }.let {
screenSources.clear() screenSources.clear()