MyReadingManga: Not result for some filters (#7044)

fix filter with , in it
This commit is contained in:
dngonz 2025-01-08 13:51:14 +01:00 committed by Draff
parent 4bc138aa39
commit 60dcde32b1
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 11 additions and 2 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'MyReadingManga' extName = 'MyReadingManga'
extClass = '.MyReadingMangaFactory' extClass = '.MyReadingMangaFactory'
extVersionCode = 54 extVersionCode = 55
isNsfw = true isNsfw = true
} }

View File

@ -318,10 +318,19 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin
Filter.Select<String>(displayName, vals.map { it }.toTypedArray(), defaultValue), UriFilter { Filter.Select<String>(displayName, vals.map { it }.toTypedArray(), defaultValue), UriFilter {
override fun addToUri(uri: Uri.Builder, uriParam: String) { override fun addToUri(uri: Uri.Builder, uriParam: String) {
if (state != 0 || !firstIsUnspecified) { if (state != 0 || !firstIsUnspecified) {
val splitFilter = vals[state].split(",")
when {
splitFilter.size == 1 -> {
val reversedFilter = splitFilter.reversed().joinToString(" | ").trim()
uri.appendQueryParameter(uriParam, "$uriValuePrefix:$reversedFilter")
}
else -> {
uri.appendQueryParameter(uriParam, "$uriValuePrefix:${vals[state]}") uri.appendQueryParameter(uriParam, "$uriValuePrefix:${vals[state]}")
} }
} }
} }
}
}
/** /**
* Represents a filter that is able to modify a URI. * Represents a filter that is able to modify a URI.