Skip to content

Commit

Permalink
status and mode as nullable in cheesegull/search api
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jun 22, 2024
1 parent 6f49287 commit e437a5a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/api/v1/cheesegull.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,18 @@ def get_osu_api_v2_search_ranked_status(
@router.get("/api/search")
async def cheesegull_search(
query: str,
status: CheesegullRankedStatus,
mode: osu_api_v2.GameMode,
status: CheesegullRankedStatus | None = None,
mode: osu_api_v2.GameMode | None = None,
offset: int = 1,
amount: int = Query(50, ge=1, le=100),
# TODO: auth, or at least per-ip ratelimit
):
ranked_status = get_osu_api_v2_search_ranked_status(status)
if ranked_status is None:
return Response(status_code=400)
if status is not None:
ranked_status = get_osu_api_v2_search_ranked_status(status)
if ranked_status is None:
return Response(status_code=400)
else:
ranked_status = None

page = offset // (amount + 1)

Expand Down

0 comments on commit e437a5a

Please sign in to comment.