From a3e47a105513869b7c85f27e9b6ef1de2decdb30 Mon Sep 17 00:00:00 2001 From: "Cuong M. Tran" Date: Tue, 6 Feb 2024 11:29:51 +0700 Subject: [PATCH] allow search source using both source's name & extensions's name --- .../eu/kanade/tachiyomi/ui/browse/source/SourcesScreenModel.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesScreenModel.kt index 15a6b346b3..73d01ec2d9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesScreenModel.kt @@ -108,12 +108,13 @@ class SourcesScreenModel( // KMK --> val queryFilter: (String?) -> ((Source) -> Boolean) = { query -> filter@{ source -> - if (nsfwOnly && source.installedExtension != null && !source.installedExtension!!.isNsfw) return@filter false + if (nsfwOnly && source.installedExtension?.isNsfw == true) return@filter false if (query.isNullOrBlank()) return@filter true query.split(",").any { val input = it.trim() if (input.isEmpty()) return@any false source.name.contains(input, ignoreCase = true) || + source.installedExtension?.name?.contains(input, ignoreCase = true) == true || source.id == input.toLongOrNull() } }