Fix online attribute flag in score performance command not retrieving full difficulty attributes #204
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Found when investigating ppy/osu#28006.
If the
performance score
command is given the-a
flag, it is supposed to use the current online beatmap difficulty attributes. It does so by querying API, which queriesosu-beatmap-difficulty-cache
.Problem is, that some of the difficulty attributes, namely the ones that are already present on
APIBeatmap
, are not serialised out byosu-beatmap-difficulty-cache
.osu-tools
is blissfully unaware of this, and as such attempts to deserialise the difficulty attributes returned from cache-then-web raw, which leads to it just using the default values (e.g. zeroes) for attributes that the difficulty lookup cache does not serialise out. This leads to obviously bogus results.To fix, retrieve the
APIBeatmap
manually and do some (admittedly gnarly) grafting in order to produce a fully populated object. It's a bit ugly but it works locally without further changes so maybe fine?The alternative would be to fix this on the beatmap difficulty cache, I guess. That said it's not like the cache/API returns these fields wrong either, it does correctly omit them, which is why I'm trying this first.