File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ def format_str_media(
92
92
elif hasattr (media , "artist" ):
93
93
result = media .artist .name
94
94
case "album_artist" :
95
+ result = name_builder_album_artist (media , first_only = True )
96
+ case "album_artists" :
95
97
result = name_builder_album_artist (media )
96
98
case "track_title" :
97
99
if isinstance (media , Track | Video ):
Original file line number Diff line number Diff line change @@ -14,14 +14,17 @@ def name_builder_artist(media: Track | Video | Album) -> str:
14
14
return ", " .join (artist .name for artist in media .artists )
15
15
16
16
17
- def name_builder_album_artist (media : Track | Album ) -> str :
17
+ def name_builder_album_artist (media : Track | Album , first_only : bool = False ) -> str :
18
18
artists_tmp : [str ] = []
19
19
artists : [Artist ] = media .album .artists if isinstance (media , Track ) else media .artists
20
20
21
21
for artist in artists :
22
22
if Role .main in artist .roles :
23
23
artists_tmp .append (artist .name )
24
24
25
+ if first_only :
26
+ break
27
+
25
28
return ", " .join (artists_tmp )
26
29
27
30
You can’t perform that action at this time.
0 commit comments