Skip to content
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

fix: wrong json property name for difficulty rating #1

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

matte-ek
Copy link
Contributor

@matte-ek matte-ek commented Aug 20, 2024

Fixes some minor stuff I caught while trying out the library today.

I was going to add the ability to pass mods onto the GetDifficultyAttributesAsync endpoint, but it seems like the API expects the data in the body of the request as JSON, and I wasn't sure how you would like to deal with cases like these, my changes FWIW.

Nice work on the library so far though, nice and easy to work with, and code is very nice.

@matte-ek matte-ek changed the title Fix 2 small issues Fix StarRating and RankedStatus's descriptions Aug 21, 2024
@matte-ek matte-ek changed the title Fix StarRating and RankedStatus's descriptions Fix StarRating and RankedStatus descriptions Aug 21, 2024
@minisbett
Copy link
Owner

minisbett commented Aug 21, 2024

Thanks!

Yeah those two are oversights. Although the RankedStatus has already been fixed, the star rating field name was definitely an oversight. As for passing mods to GetDifficultyAttributesAsync, I can add that, sure.

@matte-ek
Copy link
Contributor Author

Oh I see, didn't see that commit. Dropped the commit from my branch in case you want to merge this one.

@minisbett
Copy link
Owner

minisbett commented Aug 21, 2024

If you'd be interested in contributing by adding mod-support for the difficulty attributes:

The way I'd imagine an implementation would simply having 3 different overloads for specifying either a string (eg. HDDT), an array, or the bitwise integer flag. It seems like I also didn't implement the ruleset parameter, which could be implemented there. (ruleset_id can be ignored)

As for the fact it is a post request, I currently have my main request handler GetFromJsonAsync, which I manually pass a HttpMethod.Post to. A dirty hack, I know. Maybe it could be split up into a GetAsync and PostAsync, which both have their own specific code but call a private method inside OsuApiClient (eg. SendAsync) which then handles all the other request-related code. The PostAsync method could then allow for specifying the body, which is required to pass mods & co.

Edit: I checked your changes you linked, and I think they're pretty good. Feel free to PR them so we can work from there!

@minisbett minisbett changed the title Fix StarRating and RankedStatus descriptions fix: wrong json property name for difficulty rating Aug 21, 2024
@minisbett minisbett merged commit 945500f into minisbett:master Aug 21, 2024
@matte-ek matte-ek deleted the fix-small-stuff branch August 21, 2024 23:17
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.

2 participants