diff options
| author | Robert Honz <exislow+github@gmail.com> | 2024-01-14 17:29:39 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2024-01-14 17:29:39 +0100 |
| commit | 825130bd612e00dba18e7d558d9bd84737b6ba9f (patch) | |
| tree | 5eb200f868821eb4d3e7eb3f42e56b6eb3519b41 /tidal_dl_ng/helper/path.py | |
| parent | b59cba77c3769f193201b735341adc5aff05ac1a (diff) | |
| download | tidal-dl-ng-825130bd612e00dba18e7d558d9bd84737b6ba9f.tar.gz | |
♻️ Refactoring of MPD download. Metadata does not need an explicit `media_type` flag anymore.
Diffstat (limited to 'tidal_dl_ng/helper/path.py')
| -rw-r--r-- | tidal_dl_ng/helper/path.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py index 61e17b1..708b569 100644 --- a/tidal_dl_ng/helper/path.py +++ b/tidal_dl_ng/helper/path.py @@ -127,7 +127,9 @@ def path_file_sanitize(path_file: str, adapt: bool = False) -> (bool, str): # Sanitize path try: - pathname_sanitized = sanitize_filepath(pathname, replacement_text=" ", validate_after_sanitize=True, platform="auto") + pathname_sanitized = sanitize_filepath( + pathname, replacement_text=" ", validate_after_sanitize=True, platform="auto" + ) except ValidationError: # If adaption of path is allowed in case of an error set path to HOME. if adapt: @@ -137,7 +139,9 @@ def path_file_sanitize(path_file: str, adapt: bool = False) -> (bool, str): # Sanitize filename try: - filename_sanitized = sanitize_filename(filename, replacement_text=" ", validate_after_sanitize=True, platform="auto") + filename_sanitized = sanitize_filename( + filename, replacement_text=" ", validate_after_sanitize=True, platform="auto" + ) filename_sanitized_extension = Path(filename_sanitized).suffix # Check if the file extension was removed by shortening the filename length |
