mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Ignore error when cover is missing in Kitsu search results (fixes #4334)
This commit is contained in:
parent
16be469ecb
commit
00285a782c
1 changed files with 6 additions and 1 deletions
|
@ -19,7 +19,12 @@ class KitsuSearchManga(obj: JsonObject) {
|
||||||
private val canonicalTitle = obj["canonicalTitle"]!!.jsonPrimitive.content
|
private val canonicalTitle = obj["canonicalTitle"]!!.jsonPrimitive.content
|
||||||
private val chapterCount = obj["chapterCount"]?.jsonPrimitive?.intOrNull
|
private val chapterCount = obj["chapterCount"]?.jsonPrimitive?.intOrNull
|
||||||
val subType = obj["subtype"]?.jsonPrimitive?.contentOrNull
|
val subType = obj["subtype"]?.jsonPrimitive?.contentOrNull
|
||||||
val original = obj["posterImage"]?.jsonObject?.get("original")?.jsonPrimitive?.content
|
val original = try {
|
||||||
|
obj["posterImage"]?.jsonObject?.get("original")?.jsonPrimitive?.content
|
||||||
|
} catch (e: IllegalArgumentException) {
|
||||||
|
// posterImage is sometimes a jsonNull object instead
|
||||||
|
null
|
||||||
|
}
|
||||||
private val synopsis = obj["synopsis"]!!.jsonPrimitive.content
|
private val synopsis = obj["synopsis"]!!.jsonPrimitive.content
|
||||||
private var startDate = obj["startDate"]?.jsonPrimitive?.contentOrNull?.let {
|
private var startDate = obj["startDate"]?.jsonPrimitive?.contentOrNull?.let {
|
||||||
val outputDf = SimpleDateFormat("yyyy-MM-dd", Locale.US)
|
val outputDf = SimpleDateFormat("yyyy-MM-dd", Locale.US)
|
||||||
|
|
Loading…
Reference in a new issue