ppy / osu-web

the browser-facing portion of osu!
https://osu.ppy.sh
GNU Affero General Public License v3.0
968 stars 381 forks source link

API v2 beatmaps/xxx/scores should accept ruleset ID, not acronym #1819

Closed peppy closed 6 years ago

peppy commented 6 years ago

Required for https://github.com/ppy/osu/pull/1599.

Should be switched to ?mode=osu -> ?mode=0 or at very least support both ID and acronym (using is_numeric or something).

The osu! client doesn't (and shouldn't) need to know the string identifiers for rulesets.

nekodex commented 6 years ago

Not sure I agree with this, if anything I'd argue the opposite - the client shouldn't need to know the internal id for each game mode, esp. if we're using short names publicly across the site (i.e. scoreboards, ?mode=<shortname>, profiles user/<userid>/<shortname>, etc)?

If I were using the API, I'd not want to have to look up game mode ids before making requests... esp. if we're adding/supporting more community modes in the future?

peppy commented 6 years ago

right now the client-side database stores the online id of the ruleset. i guess we can change this to being a shortname instead, i'm indifferent. will require a fair amount of restructuring to make this happen so we need to be sure that's the direction we want to go.

fwiw i chose to base it on IDs to stay in line with other API requests (beatmaps/beatmapset) which also use primary key IDs.

nekodex commented 6 years ago

After further discussion, we've decided to use shortnames/acronyms to reference game modes instead of ids going forward and @peppy will make the required changes to the game client.