summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/helper
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2025-06-29 21:42:39 +0200
committerRobert Honz <exislow+github@gmail.com>2025-06-29 21:42:39 +0200
commitdb5c5eac9706eb5ab8d11c05f4346d64653ba83c (patch)
treedfcc03dc4e12390a3fa956ff0cd2c0bd1835df7f /tidal_dl_ng/helper
parent8fa41050ec1fe286ac0d188131af2823cf37a2af (diff)
downloadtidal-dl-ng-db5c5eac9706eb5ab8d11c05f4346d64653ba83c.tar.gz
✨ will only return the first artists. will return all album artists. Fixes #439
Diffstat (limited to 'tidal_dl_ng/helper')
-rw-r--r--tidal_dl_ng/helper/path.py2
-rw-r--r--tidal_dl_ng/helper/tidal.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py
index 7e90b61..5f8695a 100644
--- a/tidal_dl_ng/helper/path.py
+++ b/tidal_dl_ng/helper/path.py
@@ -92,6 +92,8 @@ def format_str_media(
elif hasattr(media, "artist"):
result = media.artist.name
case "album_artist":
+ result = name_builder_album_artist(media, first_only=True)
+ case "album_artists":
result = name_builder_album_artist(media)
case "track_title":
if isinstance(media, Track | Video):
diff --git a/tidal_dl_ng/helper/tidal.py b/tidal_dl_ng/helper/tidal.py
index c2c18d8..3896fa6 100644
--- a/tidal_dl_ng/helper/tidal.py
+++ b/tidal_dl_ng/helper/tidal.py
@@ -14,7 +14,7 @@ def name_builder_artist(media: Track | Video | Album) -> str:
return ", ".join(artist.name for artist in media.artists)
-def name_builder_album_artist(media: Track | Album) -> str:
+def name_builder_album_artist(media: Track | Album, first_only: bool = False) -> str:
artists_tmp: [str] = []
artists: [Artist] = media.album.artists if isinstance(media, Track) else media.artists
@@ -22,6 +22,9 @@ def name_builder_album_artist(media: Track | Album) -> str:
if Role.main in artist.roles:
artists_tmp.append(artist.name)
+ if first_only:
+ break
+
return ", ".join(artists_tmp)