From 611fbe575d23cb0d7f75d05192f8aed848aa48bb Mon Sep 17 00:00:00 2001 From: Hellow2 Date: Wed, 1 Feb 2023 14:26:54 +0100 Subject: [PATCH] yee --- src/music_kraken/database/objects/song.py | 16 +++++++++++++++- src/music_kraken/pages/encyclopaedia_metallum.py | 10 ++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/music_kraken/database/objects/song.py b/src/music_kraken/database/objects/song.py index 6da7416..14668c9 100644 --- a/src/music_kraken/database/objects/song.py +++ b/src/music_kraken/database/objects/song.py @@ -363,7 +363,11 @@ class Artist(DatabaseObject, SourceAttribute, MetadataAttribute): feature_songs: List[Song] = None, main_albums: List[Album] = None, album_type: str = None, - notes: str = None + notes: str = None, + lyrical_themes: List[str] = None, + general_genre: str = "", + country: pycountry.Country = None, + formed_in: ID3Timestamp = None ): DatabaseObject.__init__(self, id_=id_) @@ -371,7 +375,17 @@ class Artist(DatabaseObject, SourceAttribute, MetadataAttribute): TODO implement album type and notes """ self.album_type = album_type + self.country: pycountry.Country = country + """ + notes, generall genre, lyrics themes are attributes + which are meant to only use in outputs to describe the object + i mean do as you want but there aint no strict rule about em so good luck + """ self.notes = notes + self.lyrical_themes: List[str] = lyrical_themes + if self.lyrical_themes is None: + self.lyrical_themes = [] + self.general_genre = general_genre if main_albums is None: main_albums = [] diff --git a/src/music_kraken/pages/encyclopaedia_metallum.py b/src/music_kraken/pages/encyclopaedia_metallum.py index 8134648..3881573 100644 --- a/src/music_kraken/pages/encyclopaedia_metallum.py +++ b/src/music_kraken/pages/encyclopaedia_metallum.py @@ -334,6 +334,7 @@ class EncyclopaediaMetallum(Page): if "Country of origin:" == title_text: href = data.find('a').get('href') country = pycountry.countries.get(alpha_2=href.split("/")[-1]) + artist.country = country continue # not needed: Location: Minot, North Dakota @@ -349,13 +350,20 @@ class EncyclopaediaMetallum(Page): continue if "Genre:" == title_text: genre = data.text + artist.general_genre = genre continue if "Lyrical themes:" == title_text: lyrical_themes = data.text.split(", ") + artist.lyrical_themes = lyrical_themes continue if "Current label:" == title_text: label_name = data.text label_url = data.find("a").get("href") + + for album in artist.main_albums: + if album.label is not None: + continue + album.label = label_name continue """ @@ -372,6 +380,8 @@ class EncyclopaediaMetallum(Page): print("lyrical themes", lyrical_themes) print("label", label_name, label_url) + + return artist @classmethod