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,10 +51,18 @@ class Source(DatabaseObject, SongAttribute, ID3Metadata):
self.url = url self.url = url
def get_id3_dict(self) -> dict: def get_id3_dict(self) -> dict:
return { if self.type_enum == source_types.SONG:
Mapping.FILE_WEBPAGE_URL: [self.url], return {
Mapping.SOURCE_WEBPAGE_URL: [self.homepage] 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): def __str__(self):
return f"{self.src}: {self.url}" return f"{self.src}: {self.url}"