mangadex no chapter fix (#366)

This commit is contained in:
Carlos 2018-06-20 07:00:45 -04:00 committed by GitHub
parent 2c39f21d70
commit f6143e226b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -5,8 +5,8 @@ ext {
appName = 'Tachiyomi: MangaDex'
pkgNameSuffix = "all.mangadex"
extClass = '.MangadexFactory'
extVersionCode = 28
extVersionSuffix = 28
extVersionCode = 29
extVersionSuffix = 29
libVersion = '1.2'
}

View File

@ -222,7 +222,6 @@ open class Mangadex(override val lang: String, private val internalLang: String,
override fun mangaDetailsParse(response: Response): SManga {
val manga = SManga.create()
var jsonData = response.body()!!.string()
val json = JsonParser().parse(jsonData).asJsonObject
val mangaJson = json.getAsJsonObject("manga")
@ -274,7 +273,7 @@ open class Mangadex(override val lang: String, private val internalLang: String,
private fun isMangaCompleted(finalChapterNumber: String, chapterJson: JsonObject): Boolean {
val count = chapterJson.toMap().values.filter { it ->
val count = chapterJson?.toMap().values.filter { it ->
val chapterElement = it.asJsonObject
return chapterElement.get("lang_code").string == internalLang && doesFinalChapterExist(finalChapterNumber, it)
}?.count()