From b13f128ccaef09ac01f8db1a2dc8387369f9b3ea Mon Sep 17 00:00:00 2001 From: profitroll Date: Mon, 16 Jan 2023 15:39:53 +0100 Subject: [PATCH] Fixed a few mistakes --- extensions/saves.py | 4 ++-- models/saves.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/saves.py b/extensions/saves.py index 1e3dd3e..238db78 100644 --- a/extensions/saves.py +++ b/extensions/saves.py @@ -78,7 +78,7 @@ async def saves_get_by_id(id: str, apikey: APIKey = Depends(get_api_key)): async def saves_download(id: str, save_date: str, apikey: APIKey = Depends(get_api_key)): if path.exists(path.join(configGet("data", "locations"), "users", apikey, id, save_date)): # type: ignore save_path = path.join(configGet("data", "locations"), "users", apikey, id, save_date) # type: ignore - return zipfiles([f"{save_path}{sep}{id}.txt", f"{save_path}{sep}SaveGameInfo", f"{save_path}{sep}index.json"], save_name=f"{id}_{save_date}") + return zipfiles([f"{save_path}{sep}{id}", f"{save_path}{sep}SaveGameInfo", f"{save_path}{sep}index.json"], save_name=f"{id}_{save_date}") else: return HTTPException(HTTP_404_NOT_FOUND, detail="Could not find save with such id.") @@ -119,7 +119,7 @@ async def saves_post(device: str, files: List[UploadFile], apikey: APIKey = Depe with open(path.join(configGet("data", "locations"), "users", apikey, save_data["SaveGame"]["uniqueIDForThisGame"], save_date, "SaveGameInfo"), "wb") as f: # type: ignore f.write(save_info_file) - with open(path.join(configGet("data", "locations"), "users", apikey, save_data["SaveGame"]["uniqueIDForThisGame"], save_date, save_data["SaveGame"]["uniqueIDForThisGame"]+".txt"), "wb") as f: # type: ignore + with open(path.join(configGet("data", "locations"), "users", apikey, save_data["SaveGame"]["uniqueIDForThisGame"], save_date, save_data["SaveGame"]["uniqueIDForThisGame"]), "wb") as f: # type: ignore f.write(save_data_file) index = { diff --git a/models/saves.py b/models/saves.py index 324bffa..9f24ab8 100644 --- a/models/saves.py +++ b/models/saves.py @@ -10,4 +10,5 @@ class StardewSave(BaseModel): money: int played: int save_time: int + save_date: str uploaded: str \ No newline at end of file