From b45d8bf22164d266c1d0cf2079df45af26cff96e Mon Sep 17 00:00:00 2001 From: Alchav <59858495+Alchav@users.noreply.github.com> Date: Fri, 2 Sep 2022 17:37:37 -0400 Subject: [PATCH] Patch: Save patch file extension in archipelago.json (#968) --- Patch.py | 3 ++- WebHostLib/downloads.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Patch.py b/Patch.py index f90e376656f7..aaa4fc2404cf 100644 --- a/Patch.py +++ b/Patch.py @@ -17,7 +17,7 @@ import Utils -current_patch_version = 4 +current_patch_version = 5 class AutoPatchRegister(type): @@ -128,6 +128,7 @@ def get_manifest(self) -> dict: manifest = super(APDeltaPatch, self).get_manifest() manifest["base_checksum"] = self.hash manifest["result_file_ending"] = self.result_file_ending + manifest["patch_file_ending"] = self.patch_file_ending return manifest @classmethod diff --git a/WebHostLib/downloads.py b/WebHostLib/downloads.py index 528cbe5ec07b..c3a373c2e968 100644 --- a/WebHostLib/downloads.py +++ b/WebHostLib/downloads.py @@ -32,9 +32,12 @@ def download_patch(room_id, patch_id): new_zip.writestr("archipelago.json", json.dumps(manifest)) else: 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)}" \ - f"{AutoPatchRegister.patch_types[patch.game].patch_file_ending}" + f"{patch_file_ending}" new_file.seek(0) return send_file(new_file, as_attachment=True, download_name=fname) else: