From 181daf53a43152d2fa720d097ee29a0f3b36ca1e Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Tue, 1 Jul 2025 07:34:07 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20=20Windows=20drives=20w?= =?UTF-8?q?on't=20get=20sanitized=20anymore.=20Fixes=20#474?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/helper/path.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'.