diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index 719bdb8e0..c494e0bc0 100644 --- a/src/all/mangadex/build.gradle +++ b/src/all/mangadex/build.gradle @@ -5,8 +5,8 @@ ext { appName = 'Tachiyomi: MangaDex' pkgNameSuffix = "all.mangadex" extClass = '.MangadexFactory' - extVersionCode = 4 - extVersionSuffix = 4 + extVersionCode = 5 + extVersionSuffix = 5 libVersion = '1.2' } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt index a855501e4..cfdcdf43a 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt @@ -96,11 +96,10 @@ open class Mangadex(override val lang: String, private val internalLang: String, filters.forEach { filter -> when (filter) { is R18 -> { - return when { - filter.isExcluded() -> clientBuilder(NO_R18) - filter.isIncluded() -> clientBuilder(ONLY_R18) + return when (filter.state) { + 1 -> clientBuilder(ONLY_R18) + 2 -> clientBuilder(NO_R18) else -> clientBuilder(ALL) - } } } @@ -169,7 +168,7 @@ open class Mangadex(override val lang: String, private val internalLang: String, override fun chapterFromElement(element: Element): SChapter { val urlElement = element.select("td:eq(0)").first() - val dateElement = element.select("td:eq(6)").first() + val dateElement = element.select("td:eq(5)").first() val scanlatorElement = element.select("td:eq(2)").first() val chapter = SChapter.create() @@ -222,14 +221,14 @@ open class Mangadex(override val lang: String, private val internalLang: String, private class TextField(name: String, val key: String) : Filter.Text(name) private class Genre(val id: String, name: String) : Filter.CheckBox(name) private class GenreList(genres: List) : Filter.Group("Genres", genres) - private class R18(name: String) : Filter.TriState(name) + private class R18 : Filter.Select("R18+", arrayOf("Show all", "Show only", "Show none")) private class ByLetter(letters: List) : Filter.Group("Browse by Letter only", letters) private class Letters : Filter.Select("Letter", arrayOf("", "~", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")) override fun getFilterList() = FilterList( TextField("Author", "author"), TextField("Artist", "artist"), - //R18("Show R18+"), + R18(), GenreList(getGenreList()), ByLetter(listOf(Letters())) ) @@ -279,6 +278,7 @@ open class Mangadex(override val lang: String, private val internalLang: String, ) companion object { + //this number matches to the cookie const val NO_R18 = 0 const val ALL = 1 const val ONLY_R18 = 2