mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 18:32:39 +01:00
Colored Manga | Fix Latest, Pages Count, Fix Title Search (#4619)
* Fix Latest, Pages Count, Fix Title Search - "Newest" is now a new Filter that sorts by manga first upload date - Latest Updates fixed -> date parsed from latest manga chapter date, not manga upload date
This commit is contained in:
parent
9d3edbb49c
commit
7f3a7e22e3
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'ColoredManga'
|
||||
extClass = '.ColoredManga'
|
||||
extVersionCode = 35
|
||||
extVersionCode = 36
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -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 } }
|
||||
|
@ -56,7 +56,8 @@ internal open class SortFilter(name: String, selection: Selection, private val v
|
||||
}
|
||||
|
||||
private val getSortsList: List<Pair<String, String>> = listOf(
|
||||
Pair("Newest", "lat"),
|
||||
Pair("Last Updated", "lat"),
|
||||
Pair("Newest", "new"),
|
||||
Pair("Popularity", "pop"),
|
||||
Pair("Title", "tit"),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user