ppy / osu-api

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

mods param on get_scores is broken #229

Closed omkelderman closed 5 years ago

omkelderman commented 5 years ago

while documenting the mods param in #187 I did some testing and found out that when using the mods param in a get_scores call like peppy is saying in the comment on mentioned issue doesnt work.

/get_scores?k=*key*&m=0&u=4650315&b=890190 gives me this:

[{"score_id":"2652146130","score":"281620729","username":"idke","maxcombo":"3469","count50":"0","count100":"27","count300":"2565","countmiss":"0","countkatu":"23","countgeki":"386","perfect":"0","enabled_mods":"16","user_id":"4650315","date":"2018-10-13 21:03:44","rank":"S","pp":"937.053","replay_available":"1"},{"score_id":"2516698706","score":"267733850","username":"idke","maxcombo":"3470","count50":"0","count100":"3","count300":"2589","countmiss":"0","countkatu":"3","countgeki":"406","perfect":"1","enabled_mods":"0","user_id":"4650315","date":"2018-04-20 22:03:40","rank":"S","pp":"635.222","replay_available":"1"},{"score_id":"2453918604","score":"184797528","username":"idke","maxcombo":"2838","count50":"4","count100":"93","count300":"2489","countmiss":"6","countkatu":"33","countgeki":"370","perfect":"0","enabled_mods":"8","user_id":"4650315","date":"2018-01-25 09:28:08","rank":"A","pp":"442.5","replay_available":"1"},{"score_id":"2656901078","score":"79720352","username":"idke","maxcombo":"1573","count50":"0","count100":"37","count300":"2550","countmiss":"5","countkatu":"17","countgeki":"389","perfect":"0","enabled_mods":"4104","user_id":"4650315","date":"2018-10-21 01:15:24","rank":"A","pp":"329.355","replay_available":"1"},{"score_id":"2582755653","score":"36845393","username":"idke","maxcombo":"749","count50":"13","count100":"167","count300":"2397","countmiss":"15","countkatu":"73","countgeki":"318","perfect":"0","enabled_mods":"24","user_id":"4650315","date":"2018-07-13 21:07:35","rank":"A","pp":"188.633","replay_available":"0"},{"score_id":"2581898753","score":"26584053","username":"idke","maxcombo":"895","count50":"0","count100":"68","count300":"2499","countmiss":"25","countkatu":"44","countgeki":"352","perfect":"0","enabled_mods":"17","user_id":"4650315","date":"2018-07-12 18:53:37","rank":"A","pp":"184.989","replay_available":"0"}]

which is a couple scores, so all gud. Now if I want to have only one of them, lets say the first one, which has a enabled_mods value of 16, so then /get_scores?k=*key*&m=0&u=4650315&b=890190&mods=16 should work right?

I get back

null

Same for any other mod enum value I throw at it (including 0).

Sidenote: I expected for those where one exists (as per first result without mods param) to get a one item array with that score, and for entries where the mod value doesnt exist an empty array. But in neither of those cases I expected null

peppy commented 5 years ago

Thanks for the report. Should be fixed now.

omkelderman commented 5 years ago

awesome 👍