added artist attribute

This commit is contained in:
Lars Noack 2023-01-20 11:01:18 +01:00
parent 4b4a3e8fc3
commit 412dbad18b

View File

@ -51,11 +51,19 @@ class Source(DatabaseObject, SongAttribute, ID3Metadata):
self.url = url
def get_id3_dict(self) -> dict:
if self.type_enum == source_types.SONG:
return {
Mapping.FILE_WEBPAGE_URL: [self.url],
Mapping.SOURCE_WEBPAGE_URL: [self.homepage]
}
if self.type_enum == source_types.ARTIST:
return {
Mapping.ARTIST_WEBPAGE_URL: [self.url]
}
return {}
def __str__(self):
return f"{self.src}: {self.url}"