From d1af921157325a84313f3070ecaf7492cf0202b9 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Fri, 20 Jan 2023 11:43:35 +0100 Subject: [PATCH] added source attribute to artist --- src/music_kraken/database/objects/song.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/music_kraken/database/objects/song.py b/src/music_kraken/database/objects/song.py index 42ba666..c61d5dc 100644 --- a/src/music_kraken/database/objects/song.py +++ b/src/music_kraken/database/objects/song.py @@ -314,6 +314,7 @@ class Artist(DatabaseObject, ID3Metadata): self, id_: str = None, name: str = None, + sources: List[Source] = None, main_songs: List[Song] = None, feature_songs: List[Song] = None, main_albums: List[Album] = None @@ -334,6 +335,10 @@ class Artist(DatabaseObject, ID3Metadata): self.main_albums = main_albums + self.sources = [] + if sources is not None: + self.sources = sources + def __str__(self): return self.name or "" @@ -376,9 +381,12 @@ class Artist(DatabaseObject, ID3Metadata): return flat_copy_discography def get_id3_dict(self) -> dict: - return { + id3_dict = { ID3_MAPPING.ARTIST: [self.name] } + id3_dict.update(self.sources[0].get_id3_dict()) + + return id3_dict discography: List[Album] = property(fget=get_discography) features: Album = property(fget=get_features)