浏览代码

Update kitsu to not show "null" for empty descriptions

(cherry picked from commit e6ea530532523ed033fd232fcea2da8f17b973f7)
Jays2Kings 3 年之前
父节点
当前提交
634da15191
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt

+ 2 - 2
app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt

@@ -25,7 +25,7 @@ class KitsuSearchManga(obj: JsonObject) {
         // posterImage is sometimes a jsonNull object instead
         // posterImage is sometimes a jsonNull object instead
         null
         null
     }
     }
-    private val synopsis = obj["synopsis"]!!.jsonPrimitive.content
+    private val synopsis = obj["synopsis"]?.jsonPrimitive?.contentOrNull
     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)
         outputDf.format(Date(it.toLong() * 1000))
         outputDf.format(Date(it.toLong() * 1000))
@@ -38,7 +38,7 @@ class KitsuSearchManga(obj: JsonObject) {
         title = canonicalTitle
         title = canonicalTitle
         total_chapters = chapterCount ?: 0
         total_chapters = chapterCount ?: 0
         cover_url = original ?: ""
         cover_url = original ?: ""
-        summary = synopsis
+        summary = synopsis ?: ""
         tracking_url = KitsuApi.mangaUrl(media_id)
         tracking_url = KitsuApi.mangaUrl(media_id)
         publishing_status = if (endDate == null) {
         publishing_status = if (endDate == null) {
             "Publishing"
             "Publishing"