Pixiv: search fixes (#15432)

This commit is contained in:
Solitai7e 2023-02-23 22:20:33 +00:00 committed by GitHub
parent 6366c65903
commit c3dfbcdebe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Pixiv' extName = 'Pixiv'
pkgNameSuffix = 'all.pixiv' pkgNameSuffix = 'all.pixiv'
extClass = '.PixivFactory' extClass = '.PixivFactory'
extVersionCode = 1 extVersionCode = 2
isNsfw = true isNsfw = true
} }

View File

@ -88,7 +88,7 @@ class Pixiv(override val lang: String) : HttpSource() {
apiResponseParse(response) apiResponseParse(response)
override fun popularMangaRequest(page: Int): Request = override fun popularMangaRequest(page: Int): Request =
searchMangaRequest(page, "漫画", FilterList()) searchMangaRequest(page, "", FilterList())
override fun popularMangaParse(response: Response) = MangasPage( override fun popularMangaParse(response: Response) = MangasPage(
mangas = apiResponseParse<PixivSearchResults>(response) mangas = apiResponseParse<PixivSearchResults>(response)
@ -111,7 +111,7 @@ class Pixiv(override val lang: String) : HttpSource() {
} }
} }
val word = URLEncoder.encode(query, "UTF-8") val word = URLEncoder.encode(query.ifBlank { "漫画" }, "UTF-8").replace("+", "%20")
val type = if (includeNonManga) "artworks" else "manga" val type = if (includeNonManga) "artworks" else "manga"
val parameters = mapOf( val parameters = mapOf(
@ -142,7 +142,7 @@ class Pixiv(override val lang: String) : HttpSource() {
} }
override fun latestUpdatesRequest(page: Int): Request = override fun latestUpdatesRequest(page: Int): Request =
searchMangaRequest(page, "漫画", FilterList()) searchMangaRequest(page, "", FilterList())
override fun latestUpdatesParse(response: Response): MangasPage = override fun latestUpdatesParse(response: Response): MangasPage =
searchMangaParse(response) searchMangaParse(response)