[RU]Desu filter empty chapters (#11769)
* [RU]Desu filter empty chapters * back old if
This commit is contained in:
parent
e8bd48d9c6
commit
6d282d3c80
@ -6,7 +6,7 @@ ext {
|
||||
extName = 'Desu'
|
||||
pkgNameSuffix = 'ru.desu'
|
||||
extClass = '.Desu'
|
||||
extVersionCode = 15
|
||||
extVersionCode = 16
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user