Skip to content

Added new class Score#1748

Merged
fire-light42 merged 1 commit intomasterfrom
score
Jul 19, 2025
Merged

Added new class Score#1748
fire-light42 merged 1 commit intomasterfrom
score

Conversation

@fire-light42
Copy link
Copy Markdown
Collaborator

This is primary inspired by #1745 as CloudStream currently has several different ways of storing score, 0-10000, 0-100 and 0-10. This seeks to unify them into a single primitive that is easier to use.

The new syntax would be score = Score.from10("7.5") or score = Score.from5(4.1) or score = Score.from100(84) or addScore("7.5") instead of rating = text?.toFloat()?.times(1000)?.toInt()

As this is primarily to make the API easier, what do some of you extension developers think of this @phisher98 @Luna712 @Sarlay @KingLucius ?

Anyone, comment if you have any input on this.

@KingLucius
Copy link
Copy Markdown
Contributor

Totally agree 👍

@fire-light42
Copy link
Copy Markdown
Collaborator Author

Would this mean that for scoring on sync, such as with mal or anilist, will decimals finally work? I tried to implement it myself but I couldn't, and it always bothered me since I use 10 decimal system.

Or will it be easier to implement now?

I guess, but only by a negligible amount. This pull request is mostly to make it easier for first time extension developers to make sense of the scoring system, and make it easier to write for long time extension developers.

@Luna712
Copy link
Copy Markdown
Contributor

Luna712 commented Jul 18, 2025

I absolutely agree with this as well.

@phisher98
Copy link
Copy Markdown
Contributor

It's pretty good

@fire-light42 fire-light42 merged commit 8b6d0ec into master Jul 19, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants