Fixed a few mistakes

This commit is contained in:
Profitroll 2023-01-16 15:39:53 +01:00
parent 71f994c8b2
commit b13f128cca
2 changed files with 3 additions and 2 deletions

View File

@ -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 = {

View File

@ -10,4 +10,5 @@ class StardewSave(BaseModel):
money: int
played: int
save_time: int
save_date: str
uploaded: str