mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 04:37:25 +01:00
Fix Kitsu ratingTwenty
being typed as String (#1191)
The API docs and the responses type `ratingTwenty` as a "number" (Int in Kotlin, it's divided by 2 for a .5 step scale 0-10). It's nullable because an entry without a user rating returns `null` in that field.
This commit is contained in:
parent
c4d2fffb12
commit
001249a89d
@ -40,7 +40,7 @@ data class KitsuListSearchResult(
|
|||||||
"planned" -> Kitsu.PLAN_TO_READ
|
"planned" -> Kitsu.PLAN_TO_READ
|
||||||
else -> throw Exception("Unknown status")
|
else -> throw Exception("Unknown status")
|
||||||
}
|
}
|
||||||
score = userDataAttrs.ratingTwenty?.let { it.toInt() / 2.0 } ?: 0.0
|
score = userDataAttrs.ratingTwenty?.let { it / 2.0 } ?: 0.0
|
||||||
last_chapter_read = userDataAttrs.progress.toDouble()
|
last_chapter_read = userDataAttrs.progress.toDouble()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ data class KitsuListSearchItemDataAttributes(
|
|||||||
val status: String,
|
val status: String,
|
||||||
val startedAt: String?,
|
val startedAt: String?,
|
||||||
val finishedAt: String?,
|
val finishedAt: String?,
|
||||||
val ratingTwenty: String?,
|
val ratingTwenty: Int?,
|
||||||
val progress: Int,
|
val progress: Int,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user