From dfc8968b1fa09f6a5555fe3d0ae7f91375b82e40 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Thu, 25 Sep 2025 20:25:00 +0200 Subject: [PATCH] =?UTF-8?q?fix(path):=20=F0=9F=90=9B=20correct=20filename?= =?UTF-8?q?=20sanitization=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adjusted the logic in `path_file_sanitize` to ensure the sanitized filename correctly appends the file suffix after the placeholder. * This change prevents potential filename issues when handling file paths. --- tidal_dl_ng/helper/path.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py index 311527b..13bf88a 100644 --- a/tidal_dl_ng/helper/path.py +++ b/tidal_dl_ng/helper/path.py @@ -487,7 +487,9 @@ def path_file_sanitize(path_file: pathlib.Path, adapt: bool = False, uniquify: b if not sanitized_filename.endswith(path_file.suffix): sanitized_filename = ( - sanitized_filename[: -len(path_file.suffix)] + FILENAME_SANITIZE_PLACEHOLDER + path_file.suffix + sanitized_filename[: -len(path_file.suffix) - len(FILENAME_SANITIZE_PLACEHOLDER)] + + FILENAME_SANITIZE_PLACEHOLDER + + path_file.suffix ) sanitized_path = pathlib.Path(