fix some mangadex manga not being marked as complete in status
This commit is contained in:
parent
7f73094bb4
commit
c789203ff8
@ -156,8 +156,13 @@ class ApiMangaParser(private val langs: List<String>) {
|
||||
}
|
||||
}
|
||||
}
|
||||
val removeOneshots = filteredChapters.filter { !it.value.chapter.isNullOrBlank() }
|
||||
return removeOneshots.size.toString() == finalChapterNumber.toDouble().floor().toString()
|
||||
val removeOneshots = filteredChapters.asSequence()
|
||||
.map { it.value.chapter!!.toDoubleOrNull() }
|
||||
.filter { it != null }
|
||||
.map { it!!.floor() }
|
||||
.filter { it != 0 }
|
||||
.toList().distinctBy { it }
|
||||
return removeOneshots.toList().size == finalChapterNumber.toDouble().floor()
|
||||
}
|
||||
|
||||
private fun filterChapterForChecking(serializer: ApiMangaSerializer): List<Map.Entry<String, ChapterSerializer>> {
|
||||
@ -166,7 +171,7 @@ class ApiMangaParser(private val langs: List<String>) {
|
||||
.filter { langs.contains(it.value.lang_code) }
|
||||
.filter {
|
||||
it.value.chapter?.let { chapterNumber ->
|
||||
if (chapterNumber.toIntOrNull() == null) {
|
||||
if (chapterNumber.toDoubleOrNull() == null) {
|
||||
return@filter false
|
||||
}
|
||||
return@filter true
|
||||
|
Loading…
x
Reference in New Issue
Block a user