Fix genre filter not working. (#2487)

Fix genre filter not working at SuperHentais
This commit is contained in:
Alessandro Jean 2020-03-23 22:21:24 -03:00 committed by GitHub
parent 4b44edd0d7
commit c780173658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 103 additions and 103 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Super Hentais' appName = 'Tachiyomi: Super Hentais'
pkgNameSuffix = 'pt.superhentais' pkgNameSuffix = 'pt.superhentais'
extClass = '.SuperHentais' extClass = '.SuperHentais'
extVersionCode = 1 extVersionCode = 2
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -264,7 +264,7 @@ class SuperHentais : ParsedHttpSource() {
private class SortFilter : Filter.Sort("Ordem", private class SortFilter : Filter.Sort("Ordem",
SORT_LIST.map { it.third }.toTypedArray(), Selection(2, false)) SORT_LIST.map { it.third }.toTypedArray(), Selection(2, false))
private class GenreFilter : Filter.Group<Tag>("Gêneros", GENRE_LIST) private class GenreFilter(genres: List<Tag>) : Filter.Group<Tag>("Gêneros", genres)
private class ExclusiveModeFilter : Filter.CheckBox("Modo Exclusivo", true) private class ExclusiveModeFilter : Filter.CheckBox("Modo Exclusivo", true)
override fun getFilterList() = FilterList( override fun getFilterList() = FilterList(
@ -274,10 +274,110 @@ class SuperHentais : ParsedHttpSource() {
StatusFilter(), StatusFilter(),
CensureFilter(), CensureFilter(),
SortFilter(), SortFilter(),
GenreFilter(), GenreFilter(getGenreList()),
ExclusiveModeFilter() ExclusiveModeFilter()
) )
// [...document.querySelectorAll(".filter_genre.list-item")]
// .map(el => `Tag("${el.getAttribute('data-value')}", "${el.innerText}")`).join(',\n')
private fun getGenreList() = listOf(
Tag("33", "Ação"),
Tag("100", "Ahegao"),
Tag("64", "Anal"),
Tag("7", "Artes Marciais"),
Tag("134", "Ashikoki"),
Tag("233", "Aventura"),
Tag("57", "Bara"),
Tag("3", "BDSM"),
Tag("267", "Big Ass"),
Tag("266", "Big Cock"),
Tag("268", "Blowjob"),
Tag("88", "Boquete"),
Tag("95", "Brinquedos"),
Tag("156", "Bukkake"),
Tag("120", "Chikan"),
Tag("68", "Comédia"),
Tag("140", "Cosplay"),
Tag("265", "Creampie"),
Tag("241", "Dark Skin"),
Tag("212", "Demônio"),
Tag("169", "Drama"),
Tag("144", "Dupla Penetração"),
Tag("184", "Enfermeira"),
Tag("126", "Eroge"),
Tag("160", "Esporte"),
Tag("245", "Facial"),
Tag("30", "Fantasia"),
Tag("251", "Femdom"),
Tag("225", "Ficção Científica"),
Tag("273", "FootJob"),
Tag("270", "Forçado"),
Tag("51", "Futanari"),
Tag("106", "Gang Bang"),
Tag("240", "Gender Bender"),
Tag("67", "Gerakuro"),
Tag("254", "Gokkun"),
Tag("236", "Golden Shower"),
Tag("204", "Gore"),
Tag("234", "Grávida"),
Tag("148", "Grupo"),
Tag("2", "Gyaru"),
Tag("17", "Harém"),
Tag("8", "Histórico"),
Tag("250", "Horror"),
Tag("27", "Incesto"),
Tag("61", "Jogos Eróticos"),
Tag("5", "Josei"),
Tag("48", "Kemono"),
Tag("98", "Kemonomimi"),
Tag("252", "Lactação"),
Tag("177", "Magia"),
Tag("92", "Maid"),
Tag("110", "Masturbação"),
Tag("162", "Mecha"),
Tag("243", "Menage"),
Tag("154", "Milf"),
Tag("115", "Mind Break"),
Tag("248", "Mind Control"),
Tag("238", "Mistério"),
Tag("112", "Moe"),
Tag("200", "Monstros"),
Tag("79", "Nakadashi"),
Tag("46", "Netorare"),
Tag("272", "Óculos"),
Tag("1", "Oral"),
Tag("77", "Paizuri"),
Tag("237", "Paródia"),
Tag("59", "Peitões"),
Tag("274", "Pelos Pubianos"),
Tag("72", "Pettanko"),
Tag("36", "Policial"),
Tag("192", "Professora"),
Tag("4", "Psicológico"),
Tag("152", "Punição"),
Tag("242", "Raio-X"),
Tag("45", "Romance"),
Tag("253", "Seinen"),
Tag("271", "Sex Toys"),
Tag("93", "Sexo Público"),
Tag("55", "Shotacon"),
Tag("9", "Shoujo Ai"),
Tag("13", "Shounen ai"),
Tag("239", "Slice of Life"),
Tag("25", "Sobrenatural"),
Tag("96", "Superpoder"),
Tag("158", "Tentáculos"),
Tag("31", "Terror"),
Tag("249", "Thriller"),
Tag("217", "Vampiros"),
Tag("84", "Vanilla"),
Tag("23", "Vida Escolar"),
Tag("40", "Virgem"),
Tag("247", "Voyeur"),
Tag("6", "Yaoi"),
Tag("10", "Yuri")
)
private fun String.changeSize(): String = substringBefore("&w=280") + "&w512" private fun String.changeSize(): String = substringBefore("&w=280") + "&w512"
private fun Response.asJsonObject(): JsonObject = JSON_PARSER.parse(body()!!.string()).obj private fun Response.asJsonObject(): JsonObject = JSON_PARSER.parse(body()!!.string()).obj
@ -345,105 +445,5 @@ class SuperHentais : ParsedHttpSource() {
Triple("less_like", "more_like", "Nº de likes"), Triple("less_like", "more_like", "Nº de likes"),
Triple("post-less", "post-more", "Nº de capítulos") Triple("post-less", "post-more", "Nº de capítulos")
) )
// [...document.querySelectorAll(".filter_genre.list-item")]
// .map(el => `Tag("${el.getAttribute('data-value')}", "${el.innerText}")`).join(',\n')
private val GENRE_LIST = listOf(
Tag("33", "Ação"),
Tag("100", "Ahegao"),
Tag("64", "Anal"),
Tag("7", "Artes Marciais"),
Tag("134", "Ashikoki"),
Tag("233", "Aventura"),
Tag("57", "Bara"),
Tag("3", "BDSM"),
Tag("267", "Big Ass"),
Tag("266", "Big Cock"),
Tag("268", "Blowjob"),
Tag("88", "Boquete"),
Tag("95", "Brinquedos"),
Tag("156", "Bukkake"),
Tag("120", "Chikan"),
Tag("68", "Comédia"),
Tag("140", "Cosplay"),
Tag("265", "Creampie"),
Tag("241", "Dark Skin"),
Tag("212", "Demônio"),
Tag("169", "Drama"),
Tag("144", "Dupla Penetração"),
Tag("184", "Enfermeira"),
Tag("126", "Eroge"),
Tag("160", "Esporte"),
Tag("245", "Facial"),
Tag("30", "Fantasia"),
Tag("251", "Femdom"),
Tag("225", "Ficção Científica"),
Tag("273", "FootJob"),
Tag("270", "Forçado"),
Tag("51", "Futanari"),
Tag("106", "Gang Bang"),
Tag("240", "Gender Bender"),
Tag("67", "Gerakuro"),
Tag("254", "Gokkun"),
Tag("236", "Golden Shower"),
Tag("204", "Gore"),
Tag("234", "Grávida"),
Tag("148", "Grupo"),
Tag("2", "Gyaru"),
Tag("17", "Harém"),
Tag("8", "Histórico"),
Tag("250", "Horror"),
Tag("27", "Incesto"),
Tag("61", "Jogos Eróticos"),
Tag("5", "Josei"),
Tag("48", "Kemono"),
Tag("98", "Kemonomimi"),
Tag("252", "Lactação"),
Tag("177", "Magia"),
Tag("92", "Maid"),
Tag("110", "Masturbação"),
Tag("162", "Mecha"),
Tag("243", "Menage"),
Tag("154", "Milf"),
Tag("115", "Mind Break"),
Tag("248", "Mind Control"),
Tag("238", "Mistério"),
Tag("112", "Moe"),
Tag("200", "Monstros"),
Tag("79", "Nakadashi"),
Tag("46", "Netorare"),
Tag("272", "Óculos"),
Tag("1", "Oral"),
Tag("77", "Paizuri"),
Tag("237", "Paródia"),
Tag("59", "Peitões"),
Tag("274", "Pelos Pubianos"),
Tag("72", "Pettanko"),
Tag("36", "Policial"),
Tag("192", "Professora"),
Tag("4", "Psicológico"),
Tag("152", "Punição"),
Tag("242", "Raio-X"),
Tag("45", "Romance"),
Tag("253", "Seinen"),
Tag("271", "Sex Toys"),
Tag("93", "Sexo Público"),
Tag("55", "Shotacon"),
Tag("9", "Shoujo Ai"),
Tag("13", "Shounen ai"),
Tag("239", "Slice of Life"),
Tag("25", "Sobrenatural"),
Tag("96", "Superpoder"),
Tag("158", "Tentáculos"),
Tag("31", "Terror"),
Tag("249", "Thriller"),
Tag("217", "Vampiros"),
Tag("84", "Vanilla"),
Tag("23", "Vida Escolar"),
Tag("40", "Virgem"),
Tag("247", "Voyeur"),
Tag("6", "Yaoi"),
Tag("10", "Yuri")
)
} }
} }