mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-28 17:19:00 +03:00
Fix wrong anilist decimal scores
This commit is contained in:
parent
8d749df290
commit
510669ee2c
2 changed files with 2 additions and 2 deletions
|
@ -74,7 +74,7 @@ class Anilist(private val context: Context, id: Int) : TrackService(id) {
|
||||||
// Smiley
|
// Smiley
|
||||||
3 -> index * 30f
|
3 -> index * 30f
|
||||||
// 10 point decimal
|
// 10 point decimal
|
||||||
4 -> index / 10f
|
4 -> index.toFloat()
|
||||||
else -> throw Exception("Unknown score type")
|
else -> throw Exception("Unknown score type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ private val preferences: PreferencesHelper by injectLazy()
|
||||||
|
|
||||||
fun Track.toAnilistScore(): String = when (preferences.anilistScoreType().getOrDefault()) {
|
fun Track.toAnilistScore(): String = when (preferences.anilistScoreType().getOrDefault()) {
|
||||||
// 10 point
|
// 10 point
|
||||||
0 -> Math.floor(score.toDouble() / 10).toInt().toString()
|
0 -> (score.toInt() / 10).toString()
|
||||||
// 100 point
|
// 100 point
|
||||||
1 -> score.toInt().toString()
|
1 -> score.toInt().toString()
|
||||||
// 5 stars
|
// 5 stars
|
||||||
|
|
Loading…
Reference in a new issue