Fix startDate

This commit is contained in:
firelight 2024-07-29 00:48:36 +02:00 committed by GitHub
parent 5d02ac1c30
commit cae8d8604c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -449,10 +449,10 @@ class MALApi(index: Int) : AccountManager(index), SyncAPI {
null, null,
null, null,
plot = this.node.synopsis, plot = this.node.synopsis,
releaseDate = if (this.node.start_date == null) null else try {Date.from( releaseDate = if (this.node.startDate == null) null else try {Date.from(
Instant.from( Instant.from(
DateTimeFormatter.ofPattern(if (this.node.start_date.length == 4) "yyyy" else if (this.node.start_date.length == 7) "yyyy-MM" else "yyyy-MM-dd") DateTimeFormatter.ofPattern(if (this.node.startDate.length == 4) "yyyy" else if (this.node.startDate.length == 7) "yyyy-MM" else "yyyy-MM-dd")
.parse(this.node.start_date) .parse(this.node.startDate)
) )
)} catch (_: RuntimeException) {null} )} catch (_: RuntimeException) {null}
) )