Parse tags after "Tags: " string (#11198)

This commit is contained in:
BrutuZ 2022-03-22 09:49:35 -03:00 committed by GitHub
parent a8050758d2
commit 1ca834b9de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

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

View File

@ -349,7 +349,8 @@ open class Cubari(override val lang: String) : HttpSource() {
title = jsonObj["title"]!!.jsonPrimitive.content title = jsonObj["title"]!!.jsonPrimitive.content
artist = jsonObj["artist"]?.jsonPrimitive?.content ?: ARTIST_FALLBACK artist = jsonObj["artist"]?.jsonPrimitive?.content ?: ARTIST_FALLBACK
author = jsonObj["author"]?.jsonPrimitive?.content ?: AUTHOR_FALLBACK author = jsonObj["author"]?.jsonPrimitive?.content ?: AUTHOR_FALLBACK
description = jsonObj["description"]?.jsonPrimitive?.content ?: DESCRIPTION_FALLBACK description = jsonObj["description"]?.jsonPrimitive?.content?.substringBefore("Tags: ") ?: DESCRIPTION_FALLBACK
genre = jsonObj["description"]?.jsonPrimitive?.content?.substringAfter("Tags: ")
url = mangaReference?.url ?: jsonObj["url"]!!.jsonPrimitive.content url = mangaReference?.url ?: jsonObj["url"]!!.jsonPrimitive.content
thumbnail_url = jsonObj["coverUrl"]?.jsonPrimitive?.content thumbnail_url = jsonObj["coverUrl"]?.jsonPrimitive?.content
?: jsonObj["cover"]?.jsonPrimitive?.content ?: "" ?: jsonObj["cover"]?.jsonPrimitive?.content ?: ""