[RU]Desu duplicate name exception + thomNum (#7725)

This commit is contained in:
Eugene 2021-06-18 14:51:21 +05:00 committed by GitHub
parent 46b41df4c5
commit 5da4edb654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Desu'
pkgNameSuffix = 'ru.desu'
extClass = '.Desu'
extVersionCode = 10
extVersionCode = 11
libVersion = '1.2'
}

View File

@ -48,7 +48,7 @@ class Desu : HttpSource() {
private fun SManga.mangaFromJSON(obj: JSONObject, chapter: Boolean) {
val id = obj.getInt("id")
url = "/$id"
title = obj.getString("name")
title = obj.getString("name").split(" / ").first()
thumbnail_url = obj.getJSONObject("image").getString("original")
val ratingValue = obj.getString("score").toFloat()
val ratingStar = when {
@ -181,11 +181,12 @@ class Desu : HttpSource() {
ret.add(
SChapter.create().apply {
val ch = obj2.getString("ch")
val fullnumstr = obj2.getString("vol") + ". " + "Глава " + ch
val title = if (obj2.getString("title") == "null") "" else obj2.getString("title")
name = if (title.isEmpty()) {
"Глава $ch"
fullnumstr
} else {
"$ch - $title"
"$fullnumstr: $title"
}
val id = obj2.getString("id")
url = "/$cid/chapter/$id"