From ccbb1f246c01aeaa1c20864453cb55d31b9c7069 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Fri, 13 Dec 2024 10:33:35 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Fixed=20track=20volume?= =?UTF-8?q?=20number=20gets=20omitted=20on=20CDn-1.=20Fixes=20#151?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/helper/path.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py index fb7bb87..d9ff35c 100644 --- a/tidal_dl_ng/helper/path.py +++ b/tidal_dl_ng/helper/path.py @@ -160,11 +160,11 @@ def format_str_media(name: str, media: Track | Album | Playlist | UserPlaylist | case "track_volume_num_optional": if isinstance(media, Track | Video): num_volumes: int = media.album.num_volumes if hasattr(media, "album") else 1 - result = "" if media.volume_num is num_volumes else str(media.volume_num) + result = "" if num_volumes is 1 else str(media.volume_num) case "track_volume_num_optional_CD": if isinstance(media, Track | Video): num_volumes: int = media.album.num_volumes if hasattr(media, "album") else 1 - result = "" if media.volume_num is num_volumes else f"CD{media.volume_num!s}" + result = "" if num_volumes is 1 else f"CD{media.volume_num!s}" except Exception as e: # TODO: Implement better exception logging. print(e)