summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)