Add support for using the user's chosen Kitsu rating scales (#3818)

Add support for different Kitsu rating scales

Includes a database migration because we have been scaling Kitsu's
2-20 `ratingTwenty` integer value to a 1-10 (step 0.5) value and
stored that in the database.

I'm also "rounding" the values to the next lowest valid one in the
current rating system to mirror Kitsu's behaviour for this. Both Kitsu
and the app keep the misfit value around until the score is otherwise
edited, at which point the interface constrains the user selection to
only valid values (for the current system).

Maybe the RatingSystem data class is overkill, but a previous version
of mine had three constants for each system that had to be manually
associated at each corner. Encapsulating those in a little map of data
classes seemed the more ergonomic solution.
This commit is contained in:
MajorTanya
2026-08-20 20:11:27 +02:00
committed by GitHub
parent 4b5a0539e5
commit 01bfaa99ad
8 changed files with 74 additions and 12 deletions
@@ -0,0 +1,5 @@
-- rescale Kitsu (sync_id 3) scores to native 2-20 int scale
-- old scores were rescaled from Kitsu's 2-20 down to 1, 1.5, ..., 10 at the API boundary
UPDATE manga_sync
SET score = score * 2
WHERE sync_id = 3;