diff options
| author | Robert Honz <exislow+github@gmail.com> | 2025-07-01 07:34:07 +0200 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2025-07-01 07:34:07 +0200 |
| commit | 181daf53a43152d2fa720d097ee29a0f3b36ca1e (patch) | |
| tree | 318f6d6102e32da0997dd595995ae2f202ed0969 /tidal_dl_ng/helper/path.py | |
| parent | 6ddcb12bdf0b1c05bcb25f1a7f195fa60078d9d4 (diff) | |
| download | tidal-dl-ng-181daf53a43152d2fa720d097ee29a0f3b36ca1e.tar.gz | |
🛠️ Windows drives won't get sanitized anymore. Fixes #474
Diffstat (limited to 'tidal_dl_ng/helper/path.py')
| -rw-r--r-- | tidal_dl_ng/helper/path.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py index db0a17c..29347cb 100644 --- a/tidal_dl_ng/helper/path.py +++ b/tidal_dl_ng/helper/path.py @@ -278,12 +278,13 @@ def path_file_sanitize(path_file: pathlib.Path, adapt: bool = False, uniquify: b sanitized_parts = [] for part in sanitized_path.parts: - if part in sanitized_path.root: + if part in sanitized_path.anchor: sanitized_parts.append(part) else: sanitized_parts.append( sanitize_filename(part, replacement_text="_", validate_after_sanitize=True, platform="auto") ) + sanitized_path = pathlib.Path(*sanitized_parts) # Then sanitize the whole path itself. The whole path is not allowed to be longer than 'PC_NAME_MAX'. |
