From 98fb99d6bc7a7147c490f0232ca121f5c07fc10b Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Sat, 31 May 2025 12:35:56 +0200 Subject: [PATCH 1/2] Support 14.3/14.4 export path changes properly --- cdtb/export.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cdtb/export.py b/cdtb/export.py index 7d5a1bc6..e6a5c7fa 100644 --- a/cdtb/export.py +++ b/cdtb/export.py @@ -196,11 +196,12 @@ def filter_exporter(self, other): del self.wads[path] else: # compare the sha256 hashes to find the common files - # don't resolve hashes: we just need the sha256 logger.debug(f"filter modified WAD file: {path}") - other_sha256 = {wf.path_hash: wf.sha256 for wf in other_wad.files} + other_wad = {wf.path_hash: wf for wf in other_wad.files} # change the files from the wad so it only extract these - self_wad.files = [wf for wf in self_wad.files if wf.sha256 != other_sha256.get(wf.path_hash)] + # in case sha is the same but export path(s) changes, also keep the file + self_wad.files = [wf for wf in self_wad.files if (other_wf := other_wad.get(wf.path_hash)) is None or wf.sha256 != other_wf.sha256 + or list(self.converted_exported_paths(wf.path)) != list(other.converted_exported_paths(other_wf.path))] if not self_wad.files: del self.wads[path] @@ -462,6 +463,10 @@ def filter_path(exporter, path): if patch_version == "main" or patch_version >= PatchVersion("14.4"): if lang_match := re.search(r"\.(.._..)\.wad\.client$", path): subdir = f"game/{lang_match.group(1).lower()}" + # for patch 14.3, only export localized UI wad into subdirs + elif patch_version >= PatchVersion("14.3"): + if ui_lang_match := re.search(r"UI\.(.._..)\.wad\.client$", path): + subdir = f"game/{ui_lang_match.group(1).lower()}" for wf in wad.files: wf.path = f"{subdir}/{wf.path}" wad.files = [wf for wf in wad.files if filter_path(exporter, wf.path)] From 1762eb404a3b69acfa9a9fcd6877319476f161ff Mon Sep 17 00:00:00 2001 From: Moritz Bender <35152647+Morilli@users.noreply.github.com> Date: Sun, 1 Jun 2025 22:17:32 +0200 Subject: [PATCH 2/2] use == instead of >= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: BenoƮt Ryder --- cdtb/export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdtb/export.py b/cdtb/export.py index e6a5c7fa..c6205a9f 100644 --- a/cdtb/export.py +++ b/cdtb/export.py @@ -464,7 +464,7 @@ def filter_path(exporter, path): if lang_match := re.search(r"\.(.._..)\.wad\.client$", path): subdir = f"game/{lang_match.group(1).lower()}" # for patch 14.3, only export localized UI wad into subdirs - elif patch_version >= PatchVersion("14.3"): + elif patch_version == PatchVersion("14.3"): if ui_lang_match := re.search(r"UI\.(.._..)\.wad\.client$", path): subdir = f"game/{ui_lang_match.group(1).lower()}" for wf in wad.files: