From 8e9e4f02f62e4caf9d79f6392a9eee6fa9e47f49 Mon Sep 17 00:00:00 2001 From: KenjieDec <65448230+KenjieDec@users.noreply.github.com> Date: Sat, 27 Apr 2024 15:36:51 +0700 Subject: [PATCH] Comick tags filter fix (#2543) * Fixed Tags Fixed tags search that contains space and slash. * Update build.gradle * Fixed Tags Filter Fixed: Uppercase -> lowercase. Single quotation marks * Taking out the regex object Taking out the regex object so it doesn't get created every time --- src/all/comickfun/build.gradle | 2 +- .../src/eu/kanade/tachiyomi/extension/all/comickfun/Comick.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/all/comickfun/build.gradle b/src/all/comickfun/build.gradle index a84d54e9f..a99959019 100644 --- a/src/all/comickfun/build.gradle +++ b/src/all/comickfun/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Comick' extClass = '.ComickFactory' - extVersionCode = 42 + extVersionCode = 43 isNsfw = true } diff --git a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/Comick.kt b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/Comick.kt index b4099d431..3265b4c8b 100644 --- a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/Comick.kt +++ b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/Comick.kt @@ -301,7 +301,7 @@ abstract class Comick( is TagFilter -> { if (it.state.isNotEmpty()) { it.state.split(",").forEach { - addQueryParameter("tags", it.trim()) + addQueryParameter("tags", it.trim().lowercase().replace(SPACE_AND_SLASH_REGEX, "-").replace("'-", "-and-039-").replace("'", "-and-039-")) } } } @@ -453,6 +453,7 @@ abstract class Comick( companion object { const val SLUG_SEARCH_PREFIX = "id:" + private val SPACE_AND_SLASH_REGEX = Regex("[ /]") private const val IGNORED_GROUPS_PREF = "IgnoredGroups" private const val INCLUDE_MU_TAGS_PREF = "IncludeMangaUpdatesTags" private const val INCLUDE_MU_TAGS_DEFAULT = false