From ea34ba53b9d22293af4f7ffd60b021eed237d4a3 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 9 Oct 2021 16:59:18 -0400 Subject: [PATCH] Allow searching for multiple extensions at once (closes #5922) --- .../ui/browse/extension/ExtensionController.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt index c35f053d0d..ea1b55c734 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt @@ -144,7 +144,7 @@ open class ExtensionController : .filter { router.backstack.lastOrNull()?.controller == this } .onEach { query = it.toString() - drawExtensions() + updateExtensionsList() } .launchIn(viewScope) } @@ -179,7 +179,7 @@ open class ExtensionController : fun setExtensions(extensions: List) { binding.swipeRefresh.isRefreshing = false this.extensions = extensions - drawExtensions() + updateExtensionsList() // Update badge on parent controller tab val ctrl = parentController as BrowseController @@ -187,11 +187,14 @@ open class ExtensionController : ctrl.extensionListUpdateRelay.call(true) } - private fun drawExtensions() { + private fun updateExtensionsList() { if (query.isNotBlank()) { + val extensionNames = query.split(",") adapter?.updateDataSet( extensions.filter { - it.extension.name.contains(query, ignoreCase = true) + extensionNames.any { queriedName -> + it.extension.name.contains(queriedName, ignoreCase = true) + } } ) } else {