From 412dbad18b9b6974ea99a4c9cff882f5d07f765e Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Fri, 20 Jan 2023 11:01:18 +0100 Subject: [PATCH] added artist attribute --- src/music_kraken/database/objects/source.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/music_kraken/database/objects/source.py b/src/music_kraken/database/objects/source.py index 5db17c6..021a090 100644 --- a/src/music_kraken/database/objects/source.py +++ b/src/music_kraken/database/objects/source.py @@ -51,10 +51,18 @@ class Source(DatabaseObject, SongAttribute, ID3Metadata): self.url = url def get_id3_dict(self) -> dict: - return { - Mapping.FILE_WEBPAGE_URL: [self.url], - Mapping.SOURCE_WEBPAGE_URL: [self.homepage] - } + 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}"