Cubari: fix genre parsing (#14712)

This commit is contained in:
mobi2002 2022-12-29 01:33:37 +05:00 committed by GitHub
parent 5d2a17a109
commit 3a4982defd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Cubari'
pkgNameSuffix = "all.cubari"
extClass = '.CubariFactory'
extVersionCode = 15
extVersionCode = 16
}
apply from: "$rootDir/common.gradle"

View File

@ -352,7 +352,13 @@ open class Cubari(override val lang: String) : HttpSource() {
val descriptionFull = jsonObj["description"]?.jsonPrimitive?.content
description = descriptionFull?.substringBefore("Tags: ") ?: DESCRIPTION_FALLBACK
genre = if (descriptionFull!!.contains("Tags: ")) descriptionFull?.substringAfter("Tags: ") else ""
genre = descriptionFull?.let {
if (it.contains("Tags: ")) {
it.substringAfter("Tags: ")
} else {
""
}
} ?: ""
url = mangaReference?.url ?: jsonObj["url"]!!.jsonPrimitive.content
thumbnail_url = jsonObj["coverUrl"]?.jsonPrimitive?.content