Patch: Save patch file extension in archipelago.json (#968)
This commit is contained in:
parent
f7d107fc0c
commit
b45d8bf221
3
Patch.py
3
Patch.py
|
@ -17,7 +17,7 @@ ModuleUpdate.update()
|
||||||
|
|
||||||
import Utils
|
import Utils
|
||||||
|
|
||||||
current_patch_version = 4
|
current_patch_version = 5
|
||||||
|
|
||||||
|
|
||||||
class AutoPatchRegister(type):
|
class AutoPatchRegister(type):
|
||||||
|
@ -128,6 +128,7 @@ class APDeltaPatch(APContainer, metaclass=AutoPatchRegister):
|
||||||
manifest = super(APDeltaPatch, self).get_manifest()
|
manifest = super(APDeltaPatch, self).get_manifest()
|
||||||
manifest["base_checksum"] = self.hash
|
manifest["base_checksum"] = self.hash
|
||||||
manifest["result_file_ending"] = self.result_file_ending
|
manifest["result_file_ending"] = self.result_file_ending
|
||||||
|
manifest["patch_file_ending"] = self.patch_file_ending
|
||||||
return manifest
|
return manifest
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -32,9 +32,12 @@ def download_patch(room_id, patch_id):
|
||||||
new_zip.writestr("archipelago.json", json.dumps(manifest))
|
new_zip.writestr("archipelago.json", json.dumps(manifest))
|
||||||
else:
|
else:
|
||||||
new_zip.writestr(file.filename, zf.read(file), file.compress_type, 9)
|
new_zip.writestr(file.filename, zf.read(file), file.compress_type, 9)
|
||||||
|
if "patch_file_ending" in manifest:
|
||||||
|
patch_file_ending = manifest["patch_file_ending"]
|
||||||
|
else:
|
||||||
|
patch_file_ending = AutoPatchRegister.patch_types[patch.game].patch_file_ending
|
||||||
fname = f"P{patch.player_id}_{patch.player_name}_{app.jinja_env.filters['suuid'](room_id)}" \
|
fname = f"P{patch.player_id}_{patch.player_name}_{app.jinja_env.filters['suuid'](room_id)}" \
|
||||||
f"{AutoPatchRegister.patch_types[patch.game].patch_file_ending}"
|
f"{patch_file_ending}"
|
||||||
new_file.seek(0)
|
new_file.seek(0)
|
||||||
return send_file(new_file, as_attachment=True, download_name=fname)
|
return send_file(new_file, as_attachment=True, download_name=fname)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue