From c780173658881a5d72efa155b3e1e6da6bcfec8e Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Mon, 23 Mar 2020 22:21:24 -0300 Subject: [PATCH] Fix genre filter not working. (#2487) Fix genre filter not working at SuperHentais --- src/pt/superhentais/build.gradle | 2 +- .../extension/pt/superhentais/SuperHentais.kt | 204 +++++++++--------- 2 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/pt/superhentais/build.gradle b/src/pt/superhentais/build.gradle index 474a17e14..12df75db8 100644 --- a/src/pt/superhentais/build.gradle +++ b/src/pt/superhentais/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Super Hentais' pkgNameSuffix = 'pt.superhentais' extClass = '.SuperHentais' - extVersionCode = 1 + extVersionCode = 2 libVersion = '1.2' } diff --git a/src/pt/superhentais/src/eu/kanade/tachiyomi/extension/pt/superhentais/SuperHentais.kt b/src/pt/superhentais/src/eu/kanade/tachiyomi/extension/pt/superhentais/SuperHentais.kt index 9ff46c074..d2a74d916 100644 --- a/src/pt/superhentais/src/eu/kanade/tachiyomi/extension/pt/superhentais/SuperHentais.kt +++ b/src/pt/superhentais/src/eu/kanade/tachiyomi/extension/pt/superhentais/SuperHentais.kt @@ -264,7 +264,7 @@ class SuperHentais : ParsedHttpSource() { private class SortFilter : Filter.Sort("Ordem", SORT_LIST.map { it.third }.toTypedArray(), Selection(2, false)) - private class GenreFilter : Filter.Group("Gêneros", GENRE_LIST) + private class GenreFilter(genres: List) : Filter.Group("Gêneros", genres) private class ExclusiveModeFilter : Filter.CheckBox("Modo Exclusivo", true) override fun getFilterList() = FilterList( @@ -274,10 +274,110 @@ class SuperHentais : ParsedHttpSource() { StatusFilter(), CensureFilter(), SortFilter(), - GenreFilter(), + GenreFilter(getGenreList()), 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 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("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") - ) } }