✨ will only return the first artists. will return all album artists. Fixes #439
This commit is contained in:
@@ -92,6 +92,8 @@ def format_str_media(
|
|||||||
elif hasattr(media, "artist"):
|
elif hasattr(media, "artist"):
|
||||||
result = media.artist.name
|
result = media.artist.name
|
||||||
case "album_artist":
|
case "album_artist":
|
||||||
|
result = name_builder_album_artist(media, first_only=True)
|
||||||
|
case "album_artists":
|
||||||
result = name_builder_album_artist(media)
|
result = name_builder_album_artist(media)
|
||||||
case "track_title":
|
case "track_title":
|
||||||
if isinstance(media, Track | Video):
|
if isinstance(media, Track | Video):
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ def name_builder_artist(media: Track | Video | Album) -> str:
|
|||||||
return ", ".join(artist.name for artist in media.artists)
|
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_tmp: [str] = []
|
||||||
artists: [Artist] = media.album.artists if isinstance(media, Track) else media.artists
|
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:
|
if Role.main in artist.roles:
|
||||||
artists_tmp.append(artist.name)
|
artists_tmp.append(artist.name)
|
||||||
|
|
||||||
|
if first_only:
|
||||||
|
break
|
||||||
|
|
||||||
return ", ".join(artists_tmp)
|
return ", ".join(artists_tmp)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user