diff --git a/src/en/coloredmanga/build.gradle b/src/en/coloredmanga/build.gradle index 807fdd80a..8b1a265b9 100644 --- a/src/en/coloredmanga/build.gradle +++ b/src/en/coloredmanga/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'ColoredManga' extClass = '.ColoredManga' - extVersionCode = 35 + extVersionCode = 36 isNsfw = true } diff --git a/src/en/coloredmanga/src/eu/kanade/tachiyomi/extension/en/coloredmanga/ColoredManga.kt b/src/en/coloredmanga/src/eu/kanade/tachiyomi/extension/en/coloredmanga/ColoredManga.kt index fe73ddecc..c920c2d06 100644 --- a/src/en/coloredmanga/src/eu/kanade/tachiyomi/extension/en/coloredmanga/ColoredManga.kt +++ b/src/en/coloredmanga/src/eu/kanade/tachiyomi/extension/en/coloredmanga/ColoredManga.kt @@ -139,7 +139,8 @@ class ColoredManga : HttpSource() { val includeColor = colorIncluded.isEmpty() || colorIncluded.contains(it.version) val excludeColor = colorExcluded.isNotEmpty() && colorExcluded.contains(it.version) - val regularSearch = it.name.contains(title) || it.synopsis.contains(title) + val regularSearch = it.name.contains(title, true) || it.synopsis.contains(title, true) + includeGenre && !excludeGenre && includeType && !excludeType && includeColor && !excludeColor && @@ -161,7 +162,7 @@ class ColoredManga : HttpSource() { mangas.sortedBy { it.name } } } - else -> { + "new" -> { if (sort.second == "desc") { mangas.sortedByDescending { try { @@ -180,6 +181,25 @@ class ColoredManga : HttpSource() { } } } + else -> { + if (sort.second == "desc") { + mangas.sortedByDescending { + try { + dateFormat.parse(it.chapters.last().date)!!.time + } catch (e: Exception) { + 0L + } + } + } else { + mangas.sortedBy { + try { + dateFormat.parse(it.chapters.last().date)!!.time + } catch (e: Exception) { + 0L + } + } + } + } } val final = sorted.map(::popularManga) @@ -360,7 +380,7 @@ class ColoredManga : HttpSource() { val chapterJson = spChapter!!.toJson() return Observable.just( - List(spChapter.totalImage - 1) { + List(spChapter.totalImage) { val url = "https://127.0.0.1/#${it + 1}+${manga.name}" val volumeInfo = if (volumes) { manga.volume.find { vol -> vol.chapters.any { chap -> chap.number == chapter.name } } diff --git a/src/en/coloredmanga/src/eu/kanade/tachiyomi/extension/en/coloredmanga/ColoredMangaFilters.kt b/src/en/coloredmanga/src/eu/kanade/tachiyomi/extension/en/coloredmanga/ColoredMangaFilters.kt index 7347a31c3..c9a896693 100644 --- a/src/en/coloredmanga/src/eu/kanade/tachiyomi/extension/en/coloredmanga/ColoredMangaFilters.kt +++ b/src/en/coloredmanga/src/eu/kanade/tachiyomi/extension/en/coloredmanga/ColoredMangaFilters.kt @@ -56,7 +56,8 @@ internal open class SortFilter(name: String, selection: Selection, private val v } private val getSortsList: List> = listOf( - Pair("Newest", "lat"), + Pair("Last Updated", "lat"), + Pair("Newest", "new"), Pair("Popularity", "pop"), Pair("Title", "tit"), )