✨ will only return the first artists. will return all album artists. Fixes #439

This commit is contained in:
Robert Honz
2025-06-29 21:42:39 +02:00
parent 8fa41050ec
commit db5c5eac97
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -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):
+4 -1
View File
@@ -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)