mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-03 10:54:38 -05:00
Fix extracting "startDate" (#1427)
Value of json object was never properly accessed. Start date can have different formats (yyyy-MM, yyyy-MM-dd) so it's not feasible to format it
This commit is contained in:
@@ -136,13 +136,7 @@ class MyAnimeListApi(
|
|||||||
obj["status"]!!.jsonPrimitive.content.replace("_", " ")
|
obj["status"]!!.jsonPrimitive.content.replace("_", " ")
|
||||||
publishing_type =
|
publishing_type =
|
||||||
obj["media_type"]!!.jsonPrimitive.content.replace("_", " ")
|
obj["media_type"]!!.jsonPrimitive.content.replace("_", " ")
|
||||||
start_date =
|
start_date = obj["start_date"]?.jsonPrimitive?.content ?: ""
|
||||||
try {
|
|
||||||
val outputDf = SimpleDateFormat("yyyy-MM-dd", Locale.US)
|
|
||||||
outputDf.format(obj["start_date"]!!)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user