diff --git a/extensions/saves.py b/extensions/saves.py index dc50bce..919a492 100644 --- a/extensions/saves.py +++ b/extensions/saves.py @@ -87,8 +87,8 @@ async def saves_get_by_id(id: int, device: Union[str, None] = None, apikey: APIK @app.get("/saves/{id}/{save_date}", response_class=UJSONResponse, response_model=List[StardewSave], description="Get game saves by name") -async def saves_get_by_both_ids(id: int, save_date: int, apikey: APIKey = Depends(get_api_key)): - saves_entry = col_saves.find_one({"user": user_by_key(apikey), "id": id, "date": save_date}) +async def saves_get_by_both_ids(id: int, save_date: int, device: Union[str, None] = None, apikey: APIKey = Depends(get_api_key)): + saves_entry = col_saves.find_one({"user": user_by_key(apikey), "id": id, "date": save_date}) if device is None else col_saves.find_one({"user": user_by_key(apikey), "id": id, "device": device, "date": save_date}) if saves_entry is not None: del saves_entry["_id"] del saves_entry["files"]