diff --git a/extensions/saves.py b/extensions/saves.py index 9f9e852..dc50bce 100644 --- a/extensions/saves.py +++ b/extensions/saves.py @@ -46,9 +46,10 @@ def zipfiles(filenames, save_name: str) -> Response: @app.get("/saves", response_class=UJSONResponse, response_model=Dict[str, StardewSave], description="Get all available game saves") -async def saves_get(apikey: APIKey = Depends(get_api_key)): +async def saves_get(device: Union[str, None] = None, apikey: APIKey = Depends(get_api_key)): - saves_entries = list(col_saves.find({"user": user_by_key(apikey)})) + user = user_by_key(apikey) + saves_entries = list(col_saves.find({"user": user})) if device is None else list(col_saves.find({"user": user_by_key(apikey), "user": user})) if len(saves_entries) == 0: raise HTTPException(HTTP_404_NOT_FOUND, detail="Could not find any saves.")