Skip to content

Commit db5c5ea

Browse files
committed
✨ will only return the first artists. will return all album artists. Fixes #439
1 parent 8fa4105 commit db5c5ea

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tidal_dl_ng/helper/path.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ def format_str_media(
9292
elif hasattr(media, "artist"):
9393
result = media.artist.name
9494
case "album_artist":
95+
result = name_builder_album_artist(media, first_only=True)
96+
case "album_artists":
9597
result = name_builder_album_artist(media)
9698
case "track_title":
9799
if isinstance(media, Track | Video):

tidal_dl_ng/helper/tidal.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ def name_builder_artist(media: Track | Video | Album) -> str:
1414
return ", ".join(artist.name for artist in media.artists)
1515

1616

17-
def name_builder_album_artist(media: Track | Album) -> str:
17+
def name_builder_album_artist(media: Track | Album, first_only: bool = False) -> str:
1818
artists_tmp: [str] = []
1919
artists: [Artist] = media.album.artists if isinstance(media, Track) else media.artists
2020

2121
for artist in artists:
2222
if Role.main in artist.roles:
2323
artists_tmp.append(artist.name)
2424

25+
if first_only:
26+
break
27+
2528
return ", ".join(artists_tmp)
2629

2730

0 commit comments

Comments
 (0)