From 221de0405a86f709af429ea8e8c1a18500ff22e4 Mon Sep 17 00:00:00 2001 From: hackspider <467090+hackspider@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:38:45 +0200 Subject: [PATCH] Fix to allow '[' and ']' in file names The current implementation fails when a filename contains a '[' or ']'. This quickfix solves this issues (tested for chd verification only). --- verifydump/convert.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/verifydump/convert.py b/verifydump/convert.py index 5befbe8..f5ef2d4 100644 --- a/verifydump/convert.py +++ b/verifydump/convert.py @@ -53,6 +53,10 @@ def normalize_redump_bincue_dump(cue_file_path: pathlib.Path): dump_path = cue_file_path.parent dump_name = cue_file_path.stem + #Fix to allow '[' and ']' in file names + mapping_table = str.maketrans({'[': '[[]', ']': '[]]'}) + dump_name = dump_name.translate(mapping_table) + has_multiple_tracks = len(list(dump_path.glob(f"{dump_name} (Track *).bin"))) > 1 if not has_multiple_tracks: original_bin_name = f"{dump_name} (Track 1).bin"