[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 { ext {
extName = 'Com-X' extName = 'Com-X'
extClass = '.ComX' extClass = '.ComX'
extVersionCode = 29 extVersionCode = 30
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

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