mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-15 08:44:08 -05:00
Fix Tracker Status and Scores (#843)
This commit is contained in:
@@ -99,7 +99,7 @@ object Track {
|
||||
name = it.name,
|
||||
icon = proxyThumbnailUrl(it.id),
|
||||
statusList = it.getStatusList(),
|
||||
statusTextMap = it.getStatusList().associateWith { k -> it.getStatus(k) ?: "" },
|
||||
statusTextMap = it.getStatusList().associateWith { k -> it.getStatus(k).orEmpty() },
|
||||
scoreList = it.getScoreList(),
|
||||
record = record,
|
||||
)
|
||||
@@ -223,7 +223,8 @@ object Track {
|
||||
}
|
||||
if (input.scoreString != null) {
|
||||
val score = tracker.indexToScore(tracker.getScoreList().indexOf(input.scoreString))
|
||||
recordDb[TrackRecordTable.score] = score.toDouble()
|
||||
// conversion issues between Float <-> Double so convert to string before double
|
||||
recordDb[TrackRecordTable.score] = score.toString().toDouble()
|
||||
}
|
||||
if (input.startDate != null) {
|
||||
recordDb[TrackRecordTable.startDate] = input.startDate
|
||||
|
||||
@@ -50,12 +50,12 @@ class Anilist(id: Int) : Tracker(id, "AniList"), DeletableTrackService {
|
||||
@StringRes
|
||||
override fun getStatus(status: Int): String? =
|
||||
when (status) {
|
||||
READING -> "reading"
|
||||
PLAN_TO_READ -> "plan_to_read"
|
||||
COMPLETED -> "completed"
|
||||
ON_HOLD -> "on_hold"
|
||||
DROPPED -> "dropped"
|
||||
REREADING -> "repeating"
|
||||
READING -> "Reading"
|
||||
PLAN_TO_READ -> "Plan to read"
|
||||
COMPLETED -> "Completed"
|
||||
ON_HOLD -> "On hold"
|
||||
DROPPED -> "Dropped"
|
||||
REREADING -> "Rereading"
|
||||
else -> null
|
||||
}
|
||||
|
||||
|
||||
@@ -46,12 +46,12 @@ class MyAnimeList(id: Int) : Tracker(id, "MyAnimeList"), DeletableTrackService {
|
||||
@StringRes
|
||||
override fun getStatus(status: Int): String? =
|
||||
when (status) {
|
||||
READING -> "reading"
|
||||
PLAN_TO_READ -> "plan_to_read"
|
||||
COMPLETED -> "completed"
|
||||
ON_HOLD -> "on_hold"
|
||||
DROPPED -> "dropped"
|
||||
REREADING -> "repeating"
|
||||
READING -> "Reading"
|
||||
PLAN_TO_READ -> "Plan to read"
|
||||
COMPLETED -> "Completed"
|
||||
ON_HOLD -> "On hold"
|
||||
DROPPED -> "Dropped"
|
||||
REREADING -> "Rereading"
|
||||
else -> null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user