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:
schroda
2025-06-12 17:49:14 +02:00
committed by GitHub
parent e224e91100
commit 7d72ff3514

View File

@@ -136,13 +136,7 @@ class MyAnimeListApi(
obj["status"]!!.jsonPrimitive.content.replace("_", " ")
publishing_type =
obj["media_type"]!!.jsonPrimitive.content.replace("_", " ")
start_date =
try {
val outputDf = SimpleDateFormat("yyyy-MM-dd", Locale.US)
outputDf.format(obj["start_date"]!!)
} catch (e: Exception) {
""
}
start_date = obj["start_date"]?.jsonPrimitive?.content ?: ""
}
}
}