ReadManhwa - null details fix (#3181)
This commit is contained in:
parent
d665827ba8
commit
54b85ad467
|
@ -5,7 +5,7 @@ ext {
|
||||||
appName = 'Tachiyomi: ReadManhwa'
|
appName = 'Tachiyomi: ReadManhwa'
|
||||||
pkgNameSuffix = 'en.readmanhwa'
|
pkgNameSuffix = 'en.readmanhwa'
|
||||||
extClass = '.ReadManhwa'
|
extClass = '.ReadManhwa'
|
||||||
extVersionCode = 2
|
extVersionCode = 3
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.en.readmanhwa
|
||||||
import com.github.salomonbrys.kotson.fromJson
|
import com.github.salomonbrys.kotson.fromJson
|
||||||
import com.github.salomonbrys.kotson.get
|
import com.github.salomonbrys.kotson.get
|
||||||
import com.github.salomonbrys.kotson.int
|
import com.github.salomonbrys.kotson.int
|
||||||
|
import com.github.salomonbrys.kotson.nullString
|
||||||
import com.github.salomonbrys.kotson.string
|
import com.github.salomonbrys.kotson.string
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.JsonArray
|
import com.google.gson.JsonArray
|
||||||
|
@ -108,12 +109,12 @@ class ReadManhwa : HttpSource() {
|
||||||
val jsonObject = gson.fromJson<JsonObject>(response.body()!!.string())
|
val jsonObject = gson.fromJson<JsonObject>(response.body()!!.string())
|
||||||
|
|
||||||
return SManga.create().apply {
|
return SManga.create().apply {
|
||||||
description = jsonObject["description"].string
|
description = jsonObject["description"].nullString
|
||||||
status = jsonObject["status"].string.toStatus()
|
status = jsonObject["status"].nullString.toStatus()
|
||||||
thumbnail_url = jsonObject["image_url"].string
|
thumbnail_url = jsonObject["image_url"].nullString
|
||||||
genre = jsonObject["tags"].asJsonArray.joinToString { it["name"].string }
|
genre = try { jsonObject["tags"].asJsonArray.joinToString { it["name"].string } } catch (_: Exception) { null }
|
||||||
artist = jsonObject["artists"].asJsonArray.joinToString { it["name"].string }
|
artist = try { jsonObject["artists"].asJsonArray.joinToString { it["name"].string } } catch (_: Exception) { null }
|
||||||
author = jsonObject["authors"].asJsonArray.joinToString { it["name"].string }
|
author = try { jsonObject["authors"].asJsonArray.joinToString { it["name"].string } } catch (_: Exception) { null }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue