fix search + browse + filter (#6645)

This commit is contained in:
OncePunchedMan 2021-04-21 00:04:01 +02:00 committed by GitHub
parent e297c5fde1
commit 36d5f0e7f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 58 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaPill' extName = 'MangaPill'
pkgNameSuffix = 'en.mangapill' pkgNameSuffix = 'en.mangapill'
extClass = '.MangaPill' extClass = '.MangaPill'
extVersionCode = 1 extVersionCode = 2
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -22,7 +22,7 @@ class MangaPill : ParsedHttpSource() {
override val client: OkHttpClient = network.cloudflareClient override val client: OkHttpClient = network.cloudflareClient
override fun popularMangaRequest(page: Int): Request { override fun popularMangaRequest(page: Int): Request {
return GET("$baseUrl/search?page=$page&title=&type=&status=1", headers) return GET("$baseUrl/search?q=&type=&status=&page=$page", headers)
} }
override fun latestUpdatesRequest(page: Int): Request { override fun latestUpdatesRequest(page: Int): Request {
@ -104,7 +104,7 @@ class MangaPill : ParsedHttpSource() {
val url = HttpUrl.parse("$baseUrl/search")!!.newBuilder() val url = HttpUrl.parse("$baseUrl/search")!!.newBuilder()
.addQueryParameter("page", page.toString()) .addQueryParameter("page", page.toString())
.addQueryParameter("title", query) .addQueryParameter("q", query)
filters.forEach { filter -> filters.forEach { filter ->
when (filter) { when (filter) {
@ -133,13 +133,13 @@ class MangaPill : ParsedHttpSource() {
"Type", "Type",
arrayOf( arrayOf(
Pair("All", ""), Pair("All", ""),
Pair("Manga", "1"), Pair("Manga", "manga"),
Pair("Novel", "2"), Pair("Novel", "novel"),
Pair("One-Shot", "3"), Pair("One-Shot", "one-shot"),
Pair("Doujinshi", "4"), Pair("Doujinshi", "doujinshi"),
Pair("Manhwa", "5"), Pair("Manhwa", "manhwa"),
Pair("Manhua", "6"), Pair("Manhua", "manhua"),
Pair("Oel", "7") Pair("Oel", "oel")
) )
) )
@ -149,11 +149,11 @@ class MangaPill : ParsedHttpSource() {
"Status", "Status",
arrayOf( arrayOf(
Pair("All", ""), Pair("All", ""),
Pair("Publishing", "1"), Pair("Publishing", "publishing"),
Pair("Finished", "2"), Pair("Finished", "finished"),
Pair("On Hiatus", "3"), Pair("On Hiatus", "on hiatus"),
Pair("Discontinued", "4"), Pair("Discontinued", "discontinued"),
Pair("Not yet Published", "5") Pair("Not yet Published", "not yet published")
) )
) )
@ -166,49 +166,49 @@ class MangaPill : ParsedHttpSource() {
) )
private fun getGenreList() = listOf( private fun getGenreList() = listOf(
Genre("Action", "1"), Genre("Action"),
Genre("Adventure", "2"), Genre("Adventure"),
Genre("Cars", "3"), Genre("Cars"),
Genre("Comedy", "4"), Genre("Comedy"),
Genre("Dementia", "5"), Genre("Dementia"),
Genre("Demons", "6"), Genre("Demons"),
Genre("Drama", "8"), Genre("Drama"),
Genre("Ecchi", "9"), Genre("Ecchi"),
Genre("Fantasy", "10"), Genre("Fantasy"),
Genre("Game", "11"), Genre("Game"),
Genre("Harem", "35"), Genre("Harem"),
Genre("Hentai", "12"), Genre("Hentai"),
Genre("Historical", "13"), Genre("Historical"),
Genre("Horror", "14"), Genre("Horror"),
Genre("Josei", "43"), Genre("Josei"),
Genre("Kids", "15"), Genre("Kids"),
Genre("Magic", "16"), Genre("Magic"),
Genre("Martial Arts", "17"), Genre("Martial Arts"),
Genre("Mecha", "18"), Genre("Mecha"),
Genre("Military", "38"), Genre("Military"),
Genre("Music", "19"), Genre("Music"),
Genre("Mystery", "7"), Genre("Mystery"),
Genre("Parody", "20"), Genre("Parody"),
Genre("Police", "39"), Genre("Police"),
Genre("Psychological", "40"), Genre("Psychological"),
Genre("Romance", "22"), Genre("Romance"),
Genre("Samurai", "21"), Genre("Samurai"),
Genre("School", "23"), Genre("School"),
Genre("Sci-Fi", "24"), Genre("Sci-Fi"),
Genre("Seinen", "42"), Genre("Seinen"),
Genre("Shoujo", "25"), Genre("Shoujo"),
Genre("Shoujo Ai", "26"), Genre("Shoujo Ai"),
Genre("Shounen", "27"), Genre("Shounen"),
Genre("Shounen Ai", "28"), Genre("Shounen Ai"),
Genre("Slice of Life", "36"), Genre("Slice of Life"),
Genre("Space", "29"), Genre("Space"),
Genre("Sports", "30"), Genre("Sports"),
Genre("Super Power", "31"), Genre("Super Power"),
Genre("Supernatural", "37"), Genre("Supernatural"),
Genre("Thriller", "41"), Genre("Thriller"),
Genre("Vampire", "32"), Genre("Vampire"),
Genre("Yaoi", "33"), Genre("Yaoi"),
Genre("Yuri", "34") Genre("Yuri")
) )
private open class UriPartFilter(displayName: String, val vals: Array<Pair<String, String>>) : private open class UriPartFilter(displayName: String, val vals: Array<Pair<String, String>>) :