summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/helper/path.py
diff options
context:
space:
mode:
authorexislow <exislow@users.noreply.github.com>2025-09-25 20:25:52 +0200
committerGitHub <noreply@github.com>2025-09-25 20:25:52 +0200
commitbfd7b8f2528c36e22c17e5784f7dcd3ef988b84a (patch)
tree3c4939a0076b27256307fec93e131e27faf79c98 /tidal_dl_ng/helper/path.py
parentfed4cc133114d8bf4adf41df66cb10367d67417c (diff)
parentdfc8968b1fa09f6a5555fe3d0ae7f91375b82e40 (diff)
downloadtidal-dl-ng-bfd7b8f2528c36e22c17e5784f7dcd3ef988b84a.tar.gz
Merge pull request #544 from exislow/541-winerror-123-the-filename-directory-name-or-volume-label-syntax-is-incorrect-on-windows-11
fix(path): 🐛 correct filename sanitization logic
Diffstat (limited to 'tidal_dl_ng/helper/path.py')
-rw-r--r--tidal_dl_ng/helper/path.py4
1 files changed, 3 insertions, 1 deletions
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(