ppy / osu-api

Public API for accessing osu! related data.
320 stars 16 forks source link

Add username to get_user_best #281

Closed tybug closed 4 years ago

tybug commented 4 years ago

get_user and get_scores both return a username field. It would be useful for homogeneity if get_user_best did as well (avoids an extra api call on my end).

tybug commented 4 years ago

Similarly, get_user_best is missing the replay_available field. This one is actually more important because it would require calling get_scores for each of a user's top scores to get its id.

peppy commented 4 years ago

adding the replay_available field is fine, but username is completely wrong. if you're making this call you should already know the user's username.

peppy commented 4 years ago

Added

tybug commented 4 years ago

Is there a reason you think this way for get_user_best but not get_user? There are places where I only store user id, expecting to be able to retrieve all other information from it (easily, without an extra call to get_user unless necessary). And on the user's side, it is counter intuitive to force the user to input both a user id and a username.

peppy commented 4 years ago

you shouldn't be making an extra call. you should be storing the user's metadata locally so you don't need to make the call in the first place.

tybug commented 4 years ago

In a project where all of a player's metadata was needed I would use some mapping of {user_id: [username, join_date, ...], ...}, but I find myself only needing a username. I don't know how widespread this use case is, but I think there are other people who are between "I only need user id" and "I need all the metadata" who would benefit from username being included. I agree that it would be silly to provide all the metadata in calls like get_user_best, but I think username is a special and much used case, especially so because it can be changed by a user.

peppy commented 4 years ago

disagree

tybug commented 4 years ago

Fair enough! Thanks for adding replay_available in any case