NHentai: fix sort by popular month/week/day for multi language (#4671)

This commit is contained in:
Vetle Ledaal 2024-08-18 11:27:49 +02:00 committed by Draff
parent 971007cde7
commit 7f456c6dc0
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'NHentai' extName = 'NHentai'
extClass = '.NHFactory' extClass = '.NHFactory'
extVersionCode = 44 extVersionCode = 45
isNsfw = true isNsfw = true
} }

View File

@ -152,7 +152,9 @@ open class NHentai(
return GET(url.build(), headers) return GET(url.build(), headers)
} else { } else {
val url = "$baseUrl/search/".toHttpUrl().newBuilder() val url = "$baseUrl/search/".toHttpUrl().newBuilder()
.addQueryParameter("q", "$query $nhLangSearch$advQuery") // Blank query (Multi + sort by popular month/week/day) shows a 404 page
// Searching for `""` is a hacky way to return everything without any filtering
.addQueryParameter("q", "$query $nhLangSearch$advQuery".ifBlank { "\"\"" })
.addQueryParameter("page", offsetPage.toString()) .addQueryParameter("page", offsetPage.toString())
if (isOkayToSort) { if (isOkayToSort) {