From 62f995483deea26ff05cd6cbc49f0581a725735c Mon Sep 17 00:00:00 2001 From: Qamynn Date: Sun, 20 Aug 2023 14:14:20 +0200 Subject: [PATCH] Sanitize album and track attributes Now using "sanitize_filename" on the album and artist attributes. Now no accidental subdirectories get created because of characters like: ":" or "/" --- qobuz_dl/downloader.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qobuz_dl/downloader.py b/qobuz_dl/downloader.py index 952d4bc..5a6b3e5 100644 --- a/qobuz_dl/downloader.py +++ b/qobuz_dl/downloader.py @@ -254,8 +254,8 @@ class Download: @staticmethod def _get_track_attr(meta, track_title, bit_depth, sampling_rate): return { - "album": meta["album"]["title"], - "artist": meta["album"]["artist"]["name"], + "album": sanitize_filename(meta["album"]["title"]), + "artist": sanitize_filename(meta["album"]["artist"]["name"]), "tracktitle": track_title, "year": meta["album"]["release_date_original"].split("-")[0], "bit_depth": bit_depth, @@ -265,8 +265,8 @@ class Download: @staticmethod def _get_album_attr(meta, album_title, file_format, bit_depth, sampling_rate): return { - "artist": meta["artist"]["name"], - "album": album_title, + "artist": sanitize_filename(meta["artist"]["name"]), + "album": sanitize_filename(album_title), "year": meta["release_date_original"].split("-")[0], "format": file_format, "bit_depth": bit_depth,