diff --git a/src/vi/goctruyentranh/build.gradle b/src/vi/goctruyentranh/build.gradle index de2d6c172..464d32558 100644 --- a/src/vi/goctruyentranh/build.gradle +++ b/src/vi/goctruyentranh/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Goc Truyen Tranh' extClass = '.GocTruyenTranh' - extVersionCode = 1 + extVersionCode = 2 isNsfw = true } diff --git a/src/vi/goctruyentranh/src/eu/kanade/tachiyomi/extension/vi/goctruyentranh/GocTruyenTranh.kt b/src/vi/goctruyentranh/src/eu/kanade/tachiyomi/extension/vi/goctruyentranh/GocTruyenTranh.kt index 84c811d25..3705568af 100644 --- a/src/vi/goctruyentranh/src/eu/kanade/tachiyomi/extension/vi/goctruyentranh/GocTruyenTranh.kt +++ b/src/vi/goctruyentranh/src/eu/kanade/tachiyomi/extension/vi/goctruyentranh/GocTruyenTranh.kt @@ -143,10 +143,10 @@ class GocTruyenTranh : ParsedHttpSource(), ConfigurableSource { .map { it.id } .forEach { addQueryParameter("status", it) } is ChapterCountList -> - filter.state - .filter { it.state } - .map { it.id } - .forEach { addQueryParameter("minChap", it) } + { + val chapterCount = getChapterCountList()[filter.state] + addQueryParameter("minChap", chapterCount.id) + } is SortByList -> { val sort = getSortByList()[filter.state] @@ -185,8 +185,12 @@ class GocTruyenTranh : ParsedHttpSource(), ConfigurableSource { private class StatusList(status: List) : Filter.Group("Trạng Thái", status) private class Status(name: String, val id: String) : Filter.CheckBox(name) - private class ChapterCountList(chapter: List) : Filter.Group("Độ dài", chapter) - private class ChapterCount(name: String, val id: String) : Filter.CheckBox(name) + private class ChapterCountList(chapter: Array) : Filter.Select("Độ dài", chapter) + private class ChapterCount(name: String, val id: String) : Filter.CheckBox(name) { + override fun toString(): String { + return name + } + } private class SortByList(sort: Array) : Filter.Select("Sắp xếp", sort) private class SortBy(name: String, val id: String) : Filter.CheckBox(name) { @@ -212,6 +216,7 @@ class GocTruyenTranh : ParsedHttpSource(), ConfigurableSource { Country("Khác", "other"), ) private fun getSortByList() = arrayOf( + SortBy("Không", ""), SortBy("Mới nhất", "latest"), SortBy("Cũ nhất", "oldest"), SortBy("Đánh giá", "rating"), @@ -219,7 +224,8 @@ class GocTruyenTranh : ParsedHttpSource(), ConfigurableSource { SortBy("Mới cập nhật", "recently_updated"), SortBy("Xem nhiều nhất", "mostView"), ) - private fun getChapterCountList() = listOf( + private fun getChapterCountList() = arrayOf( + ChapterCount("Không", ""), ChapterCount(">= 1 chapters", "1"), ChapterCount(">= 3 chapters", "3"), ChapterCount(">= 5 chapters", "5"),