ReadManhwa: use popular for all time instead of week (#6022)

This commit is contained in:
scb261 2021-03-01 20:30:16 +02:00 committed by GitHub
parent 6a813c9ab8
commit fead080a07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'ReadManhwa' extName = 'ReadManhwa'
pkgNameSuffix = 'en.readmanhwa' pkgNameSuffix = 'en.readmanhwa'
extClass = '.ReadManhwa' extClass = '.ReadManhwa'
extVersionCode = 7 extVersionCode = 8
libVersion = '1.2' libVersion = '1.2'
containsNsfw = true containsNsfw = true
} }

View File

@ -81,7 +81,7 @@ class ReadManhwa : ConfigurableSource, HttpSource() {
// Popular // Popular
override fun popularMangaRequest(page: Int): Request { override fun popularMangaRequest(page: Int): Request {
return GET(getMangaUrl("$baseUrl/api/comics?per_page=36&page=$page&q=&sort=popularity&order=desc&duration=week"), headers) return GET(getMangaUrl("$baseUrl/api/comics?per_page=36&page=$page&q=&sort=popularity&order=desc&duration=all"), headers)
} }
override fun popularMangaParse(response: Response): MangasPage = parseMangaFromJson(response) override fun popularMangaParse(response: Response): MangasPage = parseMangaFromJson(response)
@ -102,7 +102,6 @@ class ReadManhwa : ConfigurableSource, HttpSource() {
val url = HttpUrl.parse("$baseUrl/api/comics")!!.newBuilder() val url = HttpUrl.parse("$baseUrl/api/comics")!!.newBuilder()
.addQueryParameter("per_page", "36") .addQueryParameter("per_page", "36")
.addQueryParameter("page", page.toString()) .addQueryParameter("page", page.toString())
.addQueryParameter("order", "desc")
.addQueryParameter("q", query) .addQueryParameter("q", query)
.addQueryParameter("nsfw", enableNsfw.toString()) .addQueryParameter("nsfw", enableNsfw.toString())
@ -136,13 +135,8 @@ class ReadManhwa : ConfigurableSource, HttpSource() {
} }
} }
is OrderBy -> { is OrderBy -> {
var orderby = "" val orderby = if (filter.state!!.ascending) "asc" else "desc"
if (filter.state!!.ascending) { val sort = arrayOf("uploaded_at", "title", "pages", "favorites", "popularity")[filter.state!!.index]
orderby = "asc"
} else {
orderby = "desc"
}
var sort = arrayOf("uploaded_at", "title", "pages", "favorites", "popularity")[filter.state!!.index]
url.addQueryParameter("sort", sort) url.addQueryParameter("sort", sort)
url.addQueryParameter("order", orderby) url.addQueryParameter("order", orderby)
} }