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. (cherry picked from commit 001249a89dd4824a3df5661733062662c0ab44bd)
This commit is contained in:
parent
402f5e6bad
commit
f524763854
@ -40,7 +40,7 @@ data class KitsuListSearchResult(
|
||||
"planned" -> Kitsu.PLAN_TO_READ
|
||||
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()
|
||||
}
|
||||
}
|
||||
@ -57,7 +57,7 @@ data class KitsuListSearchItemDataAttributes(
|
||||
val status: String,
|
||||
val startedAt: String?,
|
||||
val finishedAt: String?,
|
||||
val ratingTwenty: String?,
|
||||
val ratingTwenty: Int?,
|
||||
val progress: Int,
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user