summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/helper
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-03-19 07:23:35 +0100
committerRobert Honz <exislow+github@gmail.com>2024-03-19 07:23:35 +0100
commitbc88b6fcac66a2d00d380ce7c0757d7874aac1e0 (patch)
treec8016dc4782e58e3cb568daa6f8c67990daeb07a /tidal_dl_ng/helper
parentce639659b44028a88ddf6bb48a26bcd6adfcb0b0 (diff)
downloadtidal-dl-ng-bc88b6fcac66a2d00d380ce7c0757d7874aac1e0.tar.gz
🛠 Album Artist ID3 tag only shows the main album artists. Fixes #51
Diffstat (limited to 'tidal_dl_ng/helper')
-rw-r--r--tidal_dl_ng/helper/tidal.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tidal_dl_ng/helper/tidal.py b/tidal_dl_ng/helper/tidal.py
index c8b93bb..2a61bd6 100644
--- a/tidal_dl_ng/helper/tidal.py
+++ b/tidal_dl_ng/helper/tidal.py
@@ -1,4 +1,5 @@
from tidalapi import Album, Mix, Playlist, Session, Track, UserPlaylist, Video
+from tidalapi.artist import Role
from tidalapi.session import SearchTypes
from tidal_dl_ng.constants import MediaType
@@ -9,6 +10,16 @@ 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:
+ artists_tmp: [str] = []
+
+ for artist in media.album.artists:
+ if Role.main in artist.roles:
+ artists_tmp.append(artist.name)
+
+ return ", ".join(artists_tmp)
+
+
def name_builder_title(media: Track | Video) -> str:
result: str = media.full_name if hasattr(media, "full_name") else media.name