glacials / splits-io

a speedrunning data store and analysis engine
https://splits.io
GNU Affero General Public License v3.0
132 stars 26 forks source link

Add a parameter to the API to only retrieve categories that have runs #716

Closed MichaelJBerk closed 4 years ago

MichaelJBerk commented 4 years ago

When retrieving the categories of a game via the API (i.e. https://splits.io/api/v4/games/yi/categories), it will often return categories that do not have any runs associated with them (for example, in the case above, the "100% No Restrictions"(77631) category).

I propose that an optional URL parameter should be added to the API (i.e. /:game/categories?nonempty=true) that will only return categories if they have at least one run associated with them.