From 510669ee2c528694eb348d870b9222daf4c07451 Mon Sep 17 00:00:00 2001 From: len Date: Thu, 22 Dec 2016 16:22:08 +0100 Subject: [PATCH] Fix wrong anilist decimal scores --- .../main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt | 2 +- .../eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt index 70d909b7f..54ca0151c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt @@ -74,7 +74,7 @@ class Anilist(private val context: Context, id: Int) : TrackService(id) { // Smiley 3 -> index * 30f // 10 point decimal - 4 -> index / 10f + 4 -> index.toFloat() else -> throw Exception("Unknown score type") } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt index 9e1695c5c..c4623308f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt @@ -61,7 +61,7 @@ private val preferences: PreferencesHelper by injectLazy() fun Track.toAnilistScore(): String = when (preferences.anilistScoreType().getOrDefault()) { // 10 point - 0 -> Math.floor(score.toDouble() / 10).toInt().toString() + 0 -> (score.toInt() / 10).toString() // 100 point 1 -> score.toInt().toString() // 5 stars