View Trending / New via Filter (#2322)

KissManga - Enable Trending / New Manga lists
This commit is contained in:
happywillow0 2020-03-01 07:23:05 -05:00 committed by GitHub
parent 24bb1c5474
commit 29d1d99e58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Kissmanga' appName = 'Tachiyomi: Kissmanga'
pkgNameSuffix = 'en.kissmanga' pkgNameSuffix = 'en.kissmanga'
extClass = '.Kissmanga' extClass = '.Kissmanga'
extVersionCode = 10 extVersionCode = 11
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -87,6 +87,12 @@ class Kissmanga : ParsedHttpSource() {
override fun latestUpdatesNextPageSelector(): String = "ul.pager > li > a:contains(Next)" override fun latestUpdatesNextPageSelector(): String = "ul.pager > li > a:contains(Next)"
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
for (filter in filters) {
when (filter) {
is SortTrending -> if (filter.state) return GET("$baseUrl/MangaList/Trending?page=$page", headers)
is NewManga -> if (filter.state) return GET("$baseUrl/MangaList/Newest?page=$page", headers)
}
}
val form = FormBody.Builder().apply { val form = FormBody.Builder().apply {
add("mangaName", query) add("mangaName", query)
@ -190,11 +196,17 @@ class Kissmanga : ParsedHttpSource() {
private class Author : Filter.Text("Author") private class Author : Filter.Text("Author")
private class Genre(name: String) : Filter.TriState(name) private class Genre(name: String) : Filter.TriState(name)
private class GenreList(genres: List<Genre>) : Filter.Group<Genre>("Genres", genres) private class GenreList(genres: List<Genre>) : Filter.Group<Genre>("Genres", genres)
private class SortTrending: Filter.CheckBox("View Trending Manga")
private class NewManga: Filter.CheckBox("View New Manga")
override fun getFilterList() = FilterList( override fun getFilterList() = FilterList(
Author(), Author(),
Status(), Status(),
GenreList(getGenreList()) GenreList(getGenreList()),
Filter.Separator(),
Filter.Header("Change Manga List"),
SortTrending(),
NewManga()
) )
// $("select[name=\"genres\"]").map((i,el) => `Genre("${$(el).next().text().trim()}", ${i})`).get().join(',\n') // $("select[name=\"genres\"]").map((i,el) => `Genre("${$(el).next().text().trim()}", ${i})`).get().join(',\n')