Albirew/tachiyomi
Archivé
1
0
Bifurcation 0

AniList 5-star/smiley <-> 100-point values differ from the AniList website (#1631)

* adjusted anilist alternate rating values to match website

* addition to: adjusted anilist alternate rating values to match website
Cette révision appartient à :
Ian Harmon 2018-09-27 13:20:37 -04:00 révisé par inorichi
Parent 96340de17d
révision 5f568733f3
2 fichiers modifiés avec 14 ajouts et 5 suppressions

Voir le fichier

@ -95,9 +95,15 @@ class Anilist(private val context: Context, id: Int) : TrackService(id) {
// 100 point
POINT_100 -> index.toFloat()
// 5 stars
POINT_5 -> index * 20f
POINT_5 -> when {
index == 0 -> 0f
else -> index * 20f - 10f
}
// Smiley
POINT_3 -> index * 30f
POINT_3 -> when {
index == 0 -> 0f
else -> index * 25f + 10f
}
// 10 point decimal
POINT_10_DECIMAL -> index.toFloat()
else -> throw Exception("Unknown score type")
@ -108,10 +114,13 @@ class Anilist(private val context: Context, id: Int) : TrackService(id) {
val score = track.score
return when (scorePreference.getOrDefault()) {
POINT_5 -> "${(score / 20).toInt()}"
POINT_5 -> when {
score == 0f -> "0 ★"
else -> "${((score + 10) / 20).toInt()}"
}
POINT_3 -> when {
score == 0f -> "0"
score <= 30 -> "😦"
score <= 35 -> "😦"
score <= 60 -> "😐"
else -> "😊"
}

Voir le fichier

@ -97,7 +97,7 @@ fun Track.toAnilistScore(): String = when (preferences.anilistScoreType().getOrD
// Smiley
"POINT_3" -> when {
score == 0f -> "0"
score <= 30 -> ":("
score <= 35 -> ":("
score <= 60 -> ":|"
else -> ":)"
}