MangaMutiny - JsonNull fix (#3551)

* MangaMutiny - JsonNull fix
Some thumbnails and manga descriptions aren't maintained by the website.
This results in avoidable errors. Fixed with this commit.

* MangaMutiny - Increment extension version number
This commit is contained in:
E3FxGaming 2020-06-16 23:57:24 +02:00 committed by GitHub
parent cdb05415ee
commit 7220a19a58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Manga Mutiny'
pkgNameSuffix = "en.mangamutiny"
extClass = '.MangaMutiny'
extVersionCode = 1
extVersionCode = 2
libVersion = '1.2'
}

View File

@ -140,8 +140,8 @@ class MangaMutiny : HttpSource() {
"completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
description = rootNode.get("summary").asString
thumbnail_url = rootNode.get("thumbnail")?.asString
description = rootNode.getNullable("summary")?.asString
thumbnail_url = rootNode.getNullable("thumbnail")?.asString
title = rootNode.get("title").asString
url = rootNode.get("slug").asString
artist = rootNode.get("artists").asString
@ -211,7 +211,7 @@ class MangaMutiny : HttpSource() {
val mangaObject = singleItem.asJsonObject
mangasPage.add(SManga.create().apply {
this.title = mangaObject.get("title").asString
this.thumbnail_url = mangaObject.get("thumbnail")?.asString
this.thumbnail_url = mangaObject.getNullable("thumbnail")?.asString
this.url = mangaObject.get("slug").asString
})
}