diff options
| author | exislow <exislow@users.noreply.github.com> | 2024-11-10 14:22:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-10 14:22:16 +0100 |
| commit | 2ffdc90fde7fb86d48ad3f59e3d13591486220ae (patch) | |
| tree | e970e855585a45406625d702986ec8d234ce6180 | |
| parent | 07a899ab77e102f34461af4455a3e677c99f0d33 (diff) | |
| parent | ce02215d7cbf8d05998985b129adef7694bf9c1e (diff) | |
| download | tidal-dl-ng-2ffdc90fde7fb86d48ad3f59e3d13591486220ae.tar.gz | |
Merge pull request #223 from exislow/151-feature-create-a-proper-folder-structure-to-organise-tracks-which-would-be-on-multiple-cds
`{track_volume_num_optional}` and `{track_volume_num_optional_CD}` ad…
| -rw-r--r-- | tidal_dl_ng/helper/path.py | 8 | ||||
| -rw-r--r-- | tidal_dl_ng/model/cfg.py | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py index 4be06e7..3d72cdf 100644 --- a/tidal_dl_ng/helper/path.py +++ b/tidal_dl_ng/helper/path.py @@ -155,6 +155,14 @@ def format_str_media(name: str, media: Track | Album | Playlist | UserPlaylist | case "track_volume_num": if isinstance(media, Track | Video): result = str(media.volume_num) + 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) + 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}" except Exception as e: # TODO: Implement better exception logging. print(e) diff --git a/tidal_dl_ng/model/cfg.py b/tidal_dl_ng/model/cfg.py index 17a8464..2c00438 100644 --- a/tidal_dl_ng/model/cfg.py +++ b/tidal_dl_ng/model/cfg.py @@ -26,7 +26,8 @@ class Settings: quality_audio: Quality = Quality.low_320k quality_video: QualityVideo = QualityVideo.P480 format_album: str = ( - "Albums/{album_artist} - {album_title}{album_explicit}/{album_track_num}. {artist_name} - {track_title}" + "Albums/{album_artist} - {album_title}{album_explicit}/{track_volume_num_optional}" + "{album_track_num}. {artist_name} - {track_title}" ) format_playlist: str = "Playlists/{playlist_name}/{artist_name} - {track_title}" format_mix: str = "Mix/{mix_name}/{artist_name} - {track_title}" |
