-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show difficulty rating with mods applied on score pages #8599
base: master
Are you sure you want to change the base?
Conversation
@@ -54,6 +54,18 @@ public static function getMode(): string | |||
return snake_case(get_class_basename(static::class)); | |||
} | |||
|
|||
public function difficultyRating(): ?float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is to actually exist here, it at very least needs a better name. A score can't have a "difficulty rating", so it would need a beatmap prefix.
Optimally I don't think it should be in here at all, but will defer to the web team to ascertain whether a structure to make that happen is possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the closest thing I can think of is making it a relation called beatmapDifficulty
instead.
Similarly for the transformer although considering difficulty rating is the only relevant value beatmap_difficulty_rating
could be sufficient...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the difficulty difference is only when mods are applied, then this shouldn't run extra queries if there're no mods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking again, relation is quite difficult because the difficulty table uses composite primary key. Short of adding virtual column and indexing it, it's probably better being an extra select column with subquery similar to this (although with simpler query).
But then again for single request it probably doesn't matter much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if adding skipping difficulty query, then both mode and mods should be checked in case of convert maps (which would have different difficulty rating even when no other mods).
(checking beatmap model would be required in that case, otherwise the table can be checked directly)
@@ -54,6 +54,18 @@ public static function getMode(): string | |||
return snake_case(get_class_basename(static::class)); | |||
} | |||
|
|||
public function difficultyRating(): ?float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the closest thing I can think of is making it a relation called beatmapDifficulty
instead.
Similarly for the transformer although considering difficulty rating is the only relevant value beatmap_difficulty_rating
could be sufficient...
if (props.score.difficulty_rating != null) { | ||
beatmap.difficulty_rating = props.score.difficulty_rating; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be indicator that it's a modified difficulty rating instead of simply overwriting it.
After some discussion, the attribute should be fetched through external api server instead. Similar to score rank but on its own library class (with the data either fetched through score model/transformer itself or its own json). |
To elaborate, if we just want to get this in, maybe it's okay to go with it as-is rather than draw things out, but eventually we're going to want to use the lookup microservice as it will be required in the future. |
random thing my friend mentioned would be nice. not sure if this fits as an include for scoretransformer, was just the easiest way to get it to that page