Fixed a few mistakes
This commit is contained in:
parent
71f994c8b2
commit
b13f128cca
@ -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)):
|
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
|
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
|
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:
|
else:
|
||||||
return HTTPException(HTTP_404_NOT_FOUND, detail="Could not find save with such id.")
|
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
|
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)
|
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)
|
f.write(save_data_file)
|
||||||
|
|
||||||
index = {
|
index = {
|
||||||
|
@ -10,4 +10,5 @@ class StardewSave(BaseModel):
|
|||||||
money: int
|
money: int
|
||||||
played: int
|
played: int
|
||||||
save_time: int
|
save_time: int
|
||||||
|
save_date: str
|
||||||
uploaded: str
|
uploaded: str
|
Loading…
Reference in New Issue
Block a user