ppy / osu-api

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

Get mania map keycount in get_user_best #232

Closed jxu closed 5 years ago

jxu commented 5 years ago

In a get_user_best API call we provide the gamemode but I don't see how to determine how many keys the map is (ex. 4k, 7k)

peppy commented 5 years ago

WHich request are you wanting this for? multiplayer? scores? beatmaps?

jxu commented 5 years ago

This is mainly for beatmaps and scores. I know osu site displays key amount on beatmap page, but I don't see it in (old) API. It is possible to scrape but not nice. The goal is to display separate rankings for mania users based on keycount, since 7k maps tend to give a lot more pp than 4k maps, and the skillset is somewhat different. Ex. Staiain is one of the fastest 4k players out there but is rank 200ish since 7k scores are worth more.

ekgame commented 5 years ago

osu! encodes beatmap's mania key-count as the circle size, so "diff_size" in the API beatmap result is the keycount.

peppy commented 5 years ago

So this isn't actually required?

jxu commented 5 years ago

It's true that diff_size provides keycount, but when calling get_user_best this info isn't provided, so it'll require another API call (or storing a table of every ranked mania beatmap and its keycount, and looking it up) I'll update the title to reflect this

omkelderman commented 5 years ago

it kinda makes sense imo, keycount is a property of a map, and in the different endpoints that output scores there has never been a case where beatmap info was included (for example things like beatmap title or diff name or whatever), just beatmap id.

What I would do is keep a cache of beatmap info, if you dont have it, call get_beatmaps and store it in cache, if you do have it in cache use that. Idk if we have a reliable way of checking if the map has changed, but I guess the keycount of a map will probably never change, that wouldnt make any sense whatsoever