Fix proxy method not working on Cubari. (#7431)

This commit is contained in:
Alessandro Jean 2021-06-03 17:56:57 -03:00 committed by GitHub
parent 6d144464c7
commit 5295e43d68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Cubari'
pkgNameSuffix = "all.cubari"
extClass = '.CubariFactory'
extVersionCode = 6
extVersionCode = 7
libVersion = '1.2'
}

View File

@ -268,6 +268,7 @@ open class Cubari(override val lang: String) : HttpSource() {
val chapterNum = chapterEntry.key
val chapterObj = chapterEntry.value.jsonObject
val chapterGroups = chapterObj["groups"]!!.jsonObject
val volume = chapterObj["volume"]!!.jsonPrimitive.content
chapterGroups.entries.map { groupEntry ->
val groupNum = groupEntry.key
@ -288,7 +289,7 @@ open class Cubari(override val lang: String) : HttpSource() {
seriesPrefs.getLong(chapterNum, currentTimeMillis)
}
name = if (chapterObj["volume"]!!.jsonPrimitive.content != "Uncategorized") {
name = if (volume.isNotEmpty() && volume != "Uncategorized") {
// Output "Vol. 1 Ch. 1 - Chapter Name"
"Vol. " + chapterObj["volume"]!!.jsonPrimitive.content + " Ch. " +
chapterNum + " - " + chapterObj["title"]!!.jsonPrimitive.content
@ -297,7 +298,7 @@ open class Cubari(override val lang: String) : HttpSource() {
"Ch. " + chapterNum + " - " + chapterObj["title"]!!.jsonPrimitive.content
}
url = if (chapterGroups[groupNum] != null) {
url = if (chapterGroups[groupNum] is JsonArray) {
"${manga.url}/$chapterNum/$groupNum"
} else {
chapterGroups[groupNum]!!.jsonPrimitive.content