fixed double extension
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Hipstercat <tasty@hipstercat.fr>
This commit is contained in:
parent
17a291daa3
commit
4c90805a38
@ -62,10 +62,11 @@ async def upload_map(map_in: MapIn):
|
|||||||
if existing_map:
|
if existing_map:
|
||||||
return MapOut(**existing_map[0])
|
return MapOut(**existing_map[0])
|
||||||
else:
|
else:
|
||||||
uploaded_filename = f"{filename}.gck"
|
uploaded_filename = filename
|
||||||
i = 0
|
i = 0
|
||||||
while os.path.exists(f"{config['upload_path']}{uploaded_filename}"):
|
while os.path.exists(f"{config['upload_path']}{uploaded_filename}"):
|
||||||
uploaded_filename = f"{filename}-{i}.gck"
|
file_wo_ext = ".".join(filename.split('.')[0:-1])
|
||||||
|
uploaded_filename = f"{file_wo_ext}-{i}.gck"
|
||||||
i += 1
|
i += 1
|
||||||
with open(f"{config['upload_path']}{uploaded_filename}", "wb") as fp:
|
with open(f"{config['upload_path']}{uploaded_filename}", "wb") as fp:
|
||||||
fp.write(map_bytes)
|
fp.write(map_bytes)
|
||||||
|
Loading…
Reference in New Issue
Block a user