[RU]Desu filter empty chapters (#11769)

* [RU]Desu filter empty chapters

* back old if
This commit is contained in:
Ejan 2022-05-08 06:16:24 +05:00 committed by GitHub
parent e8bd48d9c6
commit 6d282d3c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Desu'
pkgNameSuffix = 'ru.desu'
extClass = '.Desu'
extVersionCode = 15
extVersionCode = 16
}
apply from: "$rootDir/common.gradle"

View File

@ -93,7 +93,7 @@ class Desu : HttpSource() {
var altName = ""
if (obj["synonyms"]!!.jsonPrimitive.contentOrNull != null) {
if (obj["synonyms"]?.jsonPrimitive?.content.orEmpty().isNotEmpty() && obj["synonyms"]!!.jsonPrimitive.contentOrNull != null) {
altName = "Альтернативные названия:\n" +
obj["synonyms"]!!.jsonPrimitive.content
.replace("|", " / ") +
@ -200,8 +200,8 @@ class Desu : HttpSource() {
.jsonObject
val cid = obj["id"]!!.jsonPrimitive.int
return obj["chapters"]!!.jsonObject["list"]!!.jsonArray.map {
val objChapter = obj["chapters"]!!
return objChapter.jsonObject["list"]!!.jsonArray.map {
val chapterObj = it.jsonObject
val ch = chapterObj["ch"]!!.jsonPrimitive.float
val fullNumStr = "${chapterObj["vol"]!!.jsonPrimitive.int}. Глава " + DecimalFormat("#,###.##").format(ch).replace(",", ".")
@ -213,7 +213,7 @@ class Desu : HttpSource() {
chapter_number = ch
date_upload = chapterObj["date"]!!.jsonPrimitive.long * 1000L
}
}
}.filter { it.chapter_number <= objChapter.jsonObject["last"]!!.jsonObject["ch"]!!.jsonPrimitive.float }
}
override fun chapterListRequest(manga: SManga): Request {