From f60782f11fd03b302bb81387f24fd56795f3c6bf Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 7 Jan 2024 17:50:02 -0500 Subject: [PATCH] Avoid floating point precision issues when converting scores Fixes #10343 Maybe we'll finally migrate off of those legacy models some day... --- app/src/main/java/eu/kanade/domain/track/model/Track.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/domain/track/model/Track.kt b/app/src/main/java/eu/kanade/domain/track/model/Track.kt index e84e28ff0c..332ddd8d51 100644 --- a/app/src/main/java/eu/kanade/domain/track/model/Track.kt +++ b/app/src/main/java/eu/kanade/domain/track/model/Track.kt @@ -40,7 +40,9 @@ fun DbTrack.toDomainTrack(idRequired: Boolean = true): Track? { lastChapterRead = last_chapter_read.toDouble(), totalChapters = total_chapters.toLong(), status = status.toLong(), - score = score.toDouble(), + // Jank workaround due to precision issues while converting + // See https://github.com/tachiyomiorg/tachiyomi/issues/10343 + score = score.toString().toDouble(), remoteUrl = tracking_url, startDate = started_reading_date, finishDate = finished_reading_date,