From d0f26eff139fa8b72862bad0ff553c76033e8873 Mon Sep 17 00:00:00 2001 From: Riztard Lanthorn Date: Thu, 20 Oct 2022 21:36:00 +0700 Subject: [PATCH] Cubari: fix long genre/tag issue (#13929) Closes #13905 --- src/all/cubari/build.gradle | 2 +- .../src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/all/cubari/build.gradle b/src/all/cubari/build.gradle index 5b4a0ee78..ad06cd448 100644 --- a/src/all/cubari/build.gradle +++ b/src/all/cubari/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Cubari' pkgNameSuffix = "all.cubari" extClass = '.CubariFactory' - extVersionCode = 14 + extVersionCode = 15 } apply from: "$rootDir/common.gradle" diff --git a/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt b/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt index 11fef9e4c..49212b3d6 100644 --- a/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt +++ b/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt @@ -349,8 +349,11 @@ open class Cubari(override val lang: String) : HttpSource() { title = jsonObj["title"]!!.jsonPrimitive.content artist = jsonObj["artist"]?.jsonPrimitive?.content ?: ARTIST_FALLBACK author = jsonObj["author"]?.jsonPrimitive?.content ?: AUTHOR_FALLBACK - description = jsonObj["description"]?.jsonPrimitive?.content?.substringBefore("Tags: ") ?: DESCRIPTION_FALLBACK - genre = jsonObj["description"]?.jsonPrimitive?.content?.substringAfter("Tags: ") + + val descriptionFull = jsonObj["description"]?.jsonPrimitive?.content + description = descriptionFull?.substringBefore("Tags: ") ?: DESCRIPTION_FALLBACK + genre = if (descriptionFull!!.contains("Tags: ")) descriptionFull?.substringAfter("Tags: ") else "" + url = mangaReference?.url ?: jsonObj["url"]!!.jsonPrimitive.content thumbnail_url = jsonObj["coverUrl"]?.jsonPrimitive?.content ?: jsonObj["cover"]?.jsonPrimitive?.content ?: ""