Komiku: fix search issue (#14670)

Closes #13402
This commit is contained in:
Luqman 2022-12-27 07:24:43 +07:00 committed by GitHub
parent e90a68fefc
commit d156ff87c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Komiku' extName = 'Komiku'
pkgNameSuffix = 'id.komiku' pkgNameSuffix = 'id.komiku'
extClass = '.Komiku' extClass = '.Komiku'
extVersionCode = 15 extVersionCode = 16
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -21,6 +21,8 @@ class Komiku : ParsedHttpSource() {
override val baseUrl = "https://komiku.id" override val baseUrl = "https://komiku.id"
private val baseUrlData = "https://data.komiku.id"
override val lang = "id" override val lang = "id"
override val supportsLatest = true override val supportsLatest = true
@ -31,10 +33,10 @@ class Komiku : ParsedHttpSource() {
override fun popularMangaSelector() = "div.bge" override fun popularMangaSelector() = "div.bge"
override fun popularMangaRequest(page: Int): Request { override fun popularMangaRequest(page: Int): Request {
if (page == 1) { return if (page == 1) {
return GET("$baseUrl/other/hot/?orderby=meta_value_num", headers) GET("$baseUrl/other/hot/?orderby=meta_value_num", headers)
} else { } else {
return GET("$baseUrl/other/hot/page/$page/?orderby=meta_value_num", headers) GET("$baseUrl/other/hot/page/$page/?orderby=meta_value_num", headers)
} }
} }
@ -79,7 +81,7 @@ class Komiku : ParsedHttpSource() {
override fun searchMangaSelector() = popularMangaSelector() override fun searchMangaSelector() = popularMangaSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
var url = "$baseUrl/pustaka/page/$page/".toHttpUrlOrNull()?.newBuilder()!!.addQueryParameter("s", query) var url = "$baseUrlData/page/$page/?post_type=manga".toHttpUrlOrNull()?.newBuilder()!!.addQueryParameter("s", query)
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter -> (if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
when (filter) { when (filter) {
is CategoryNames -> { is CategoryNames -> {