Madara - genre search, add 3 sources (#1735)

Madara - genre search, add 3 sources
This commit is contained in:
Mike 2019-11-03 08:58:37 -05:00 committed by arkon
parent 00fc73e56f
commit 5e5988e874
3 changed files with 101 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Madara (multiple sources)'
pkgNameSuffix = "all.madara"
extClass = '.MadaraFactory'
extVersionCode = 24
extVersionCode = 25
libVersion = '1.2'
}

View File

@ -167,6 +167,19 @@ abstract class Madara(
url.addQueryParameter("m_orderby", filter.toUriPart())
}
}
is GenreList -> {
val genreInclude = mutableListOf<String>()
filter.state.forEach {
if (it.state) {
genreInclude.add(it.id)
}
}
if(genreInclude.isNotEmpty()){
genreInclude.forEach{ genre ->
url.addQueryParameter("genre[]", genre)
}
}
}
}
}
return GET(url.build().toString(), headers)
@ -185,13 +198,80 @@ abstract class Madara(
Pair("Most Views", "views"),
Pair("New", "new-manga")
))
private class GenreList(genres: List<Genre>) : Filter.Group<Genre>("Genres", genres)
class Genre(name: String, val id: String = name) : Filter.CheckBox(name)
open fun getGenreList() = listOf(
Genre("Adventure", "Adventure"),
Genre( "Action", "action"),
Genre( "Adventure", "adventure"),
Genre( "Cars", "cars"),
Genre( "4-Koma", "4-koma"),
Genre( "Comedy", "comedy"),
Genre( "Completed", "completed"),
Genre( "Cooking", "cooking"),
Genre( "Dementia", "dementia"),
Genre( "Demons", "demons"),
Genre( "Doujinshi", "doujinshi"),
Genre( "Drama", "drama"),
Genre( "Ecchi", "ecchi"),
Genre( "Fantasy", "fantasy"),
Genre( "Game", "game"),
Genre( "Gender Bender", "gender-bender"),
Genre( "Harem", "harem"),
Genre( "Historical", "historical"),
Genre( "Horror", "horror"),
Genre( "Isekai", "isekai"),
Genre( "Josei", "josei"),
Genre( "Kids", "kids"),
Genre( "Magic", "magic"),
Genre( "Manga", "manga"),
Genre( "Manhua", "manhua"),
Genre( "Manhwa", "manhwa"),
Genre( "Martial Arts", "martial-arts"),
Genre( "Mature", "mature"),
Genre( "Mecha", "mecha"),
Genre( "Military", "military"),
Genre( "Music", "music"),
Genre( "Mystery", "mystery"),
Genre( "Old Comic", "old-comic"),
Genre( "One Shot", "one-shot"),
Genre( "Oneshot", "oneshot"),
Genre( "Parodi", "parodi"),
Genre( "Parody", "parody"),
Genre( "Police", "police"),
Genre( "Psychological", "psychological"),
Genre( "Romance", "romance"),
Genre( "Samurai", "samurai"),
Genre( "School", "school"),
Genre( "School Life", "school-life"),
Genre( "Sci-Fi", "sci-fi"),
Genre( "Seinen", "seinen"),
Genre( "Shoujo", "shoujo"),
Genre( "Shoujo Ai", "shoujo-ai"),
Genre( "Shounen", "shounen"),
Genre( "Shounen ai", "shounen-ai"),
Genre( "Slice of Life", "slice-of-life"),
Genre( "Sports", "sports"),
Genre( "Super Power", "super-power"),
Genre( "Supernatural", "supernatural"),
Genre( "Thriller", "thriller"),
Genre( "Tragedy", "tragedy"),
Genre( "Vampire", "vampire"),
Genre( "Webtoons", "webtoons"),
Genre( "Yaoi", "yaoi"),
Genre( "Yuri", "yuri")
)
override fun getFilterList() = FilterList(
AuthorFilter(),
ArtistFilter(),
YearFilter(),
StatusFilter(getStatusList()),
OrderByFilter()
OrderByFilter(),
Filter.Separator(),
Filter.Header("Genres may not work for all sources"),
GenreList(getGenreList())
)
private fun getStatusList() = listOf(

View File

@ -49,7 +49,10 @@ class MadaraFactory : SourceFactory {
Manga3asq(),
NManhwa(),
Indiancomicsonline(),
AdonisFansub()
AdonisFansub(),
GetManhwa(),
AllPornComic(),
Milftoon()
)
}
@ -216,3 +219,18 @@ class AdonisFansub : Madara("Adonis Fansub", "https://manga.adonisfansub.com", "
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=views", headers)
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=latest", headers)
}
class GetManhwa : Madara("GetManhwa", "https://getmanhwa.co", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class AllPornComic : Madara("AllPornComic", "https://allporncomic.com", "en") {
override fun searchMangaNextPageSelector() = "a[rel=next]"
override fun getGenreList() = listOf(
Genre("3D", "3d"),
Genre("Hentai", "hentai"),
Genre("Western", "western")
)
}
class Milftoon : Madara("Milftoon", "https://milftoon.xxx", "en") {
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/page/$page/?m_orderby=views", headers)
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/page/$page/?m_orderby=latest", headers)
}