Skip to content

Commit

Permalink
Expose old API routes for migration
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jun 22, 2024
1 parent f0a2310 commit 0970cea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/api/v1/cheesegull.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ def from_osu_api_beatmapset(


@router.get("/api/v1/cheesegull/b/{beatmap_id}")
@router.get("/api/b/{beatmap_id}")
async def cheesegull_beatmap(beatmap_id: int):
osu_api_beatmap = await osu_api_v2.get_beatmap(beatmap_id)
if osu_api_beatmap is None:
return Response(status_code=404)

cheesegull_beatmap = CheesegullBeatmap.from_osu_api_beatmap(osu_api_beatmap)
logging.info(
"Serving cheesegull beatmap",
Expand All @@ -119,10 +121,12 @@ async def cheesegull_beatmap(beatmap_id: int):


@router.get("/api/v1/cheesegull/s/{beatmapset_id}")
@router.get("/api/s/{beatmapset_id}")
async def cheesegull_beatmapset(beatmapset_id: int):
osu_api_beatmapset = await osu_api_v2.get_beatmapset(beatmapset_id)
if osu_api_beatmapset is None:
return Response(status_code=404)

cheesegull_beatmapset = CheesegullBeatmapset.from_osu_api_beatmapset(
osu_api_beatmapset,
)
Expand Down

0 comments on commit 0970cea

Please sign in to comment.