ppy / osu-api

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

Allow /get_user to accept old usernames #242

Closed minwoo0jo closed 5 years ago

minwoo0jo commented 5 years ago

I'm currently working on a project that deals with using old tournament records and 99% of them used challonge to save the bracket results. Unfortunately, challonge only uses usernames and many of these players have either changed their name or gotten restricted.

My issue is that it seems quite impossible to tell the difference between the two because the /get_user call doesn't allow for old name queries.

It would be great if the result of /get_user could instead be a list of all users that have used the name in the past, with the current user of the name as the first result. Maybe a parameter such as old_u could be an option to allow for this functionality.

This would also go a long way towards helping to find players with new names, although there is still the issue of multiple players having the old name.

peppy commented 5 years ago

This is now supported (automatically).

minwoo0jo commented 5 years ago

This seems to work when there's only one user that matches (searching for "Cookiezi" returns "nathan on osu") but when there is both a current user of the name and an old user of the name, it only returns the current user (examples are "RIP" "Amatsukaze" "HDHR" and "My Aim Sucks" which are all names used previously by prominent players that are now used by other players). Is there any way for the search to return all matches in the form of a list?

ThePooN commented 5 years ago

Just chiming in to say that wouldn't even be a breaking change since the osu! API has always been returning an array despite get_user never possibly returning more than one entry (at least up to this day).

peppy commented 5 years ago

I believe this may be best left for api v2. Will have a discussion with the team.

peppy commented 5 years ago

Decided to not add this one – the overhead using the old lookup system would be a touch too high. Can be revisited with apiv2.