[RU]ComX fix looping Search (#5524)

* [RU]ComX fix looping Search

* addPathSegment
This commit is contained in:
Eshlender 2024-10-16 10:52:03 +05:00 committed by GitHub
parent a88c11a359
commit 90410c44ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 11 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Com-X'
extClass = '.ComX'
extVersionCode = 29
extVersionCode = 30
}
apply from: "$rootDir/common.gradle"

View File

@ -26,6 +26,7 @@ import okhttp3.CookieJar
import okhttp3.FormBody
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
@ -167,16 +168,12 @@ class ComX : ParsedHttpSource() {
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
if (query.isNotEmpty()) {
return POST(
"$baseUrl/index.php?do=search",
body = FormBody.Builder()
.add("do", "search")
.add("subaction", "search")
.add("story", query)
.add("search_start", page.toString())
.build(),
headers = headers,
)
val url = baseUrl.toHttpUrl().newBuilder().apply {
addPathSegment("search")
addPathSegment(query)
addPathSegments("page/$page")
}.build()
return GET(url, headers)
}
val mutableGenre = mutableListOf<String>()
val mutableType = mutableListOf<String>()