From f858b97a17b1f812be6e75741b59aae40578ce93 Mon Sep 17 00:00:00 2001 From: Hellow2 Date: Tue, 14 Mar 2023 12:02:58 +0100 Subject: [PATCH] made better --- src/create_custom_objects.py | 6 +---- src/metal_archives.py | 2 ++ src/music_kraken/recurse/__init__.py | 3 --- src/music_kraken/recurse/build.py | 35 ---------------------------- 4 files changed, 3 insertions(+), 43 deletions(-) delete mode 100644 src/music_kraken/recurse/__init__.py delete mode 100644 src/music_kraken/recurse/build.py diff --git a/src/create_custom_objects.py b/src/create_custom_objects.py index 1312d19..47017be 100644 --- a/src/create_custom_objects.py +++ b/src/create_custom_objects.py @@ -60,8 +60,4 @@ song = objects.Song( song.compile() -print(song.option_string) -for album in song.album_collection: - print(album.option_string) -for artist in song.main_artist_collection: - print(artist.option_string) +print(song.options) diff --git a/src/metal_archives.py b/src/metal_archives.py index d3dfd4f..1d2f7e6 100644 --- a/src/metal_archives.py +++ b/src/metal_archives.py @@ -10,5 +10,7 @@ results = EncyclopaediaMetallum.search_by_query("#a Happy Days") artist = results[0] artist: objects.Artist = EncyclopaediaMetallum.fetch_details(artist) + +artist.compile() print(artist.options) print() diff --git a/src/music_kraken/recurse/__init__.py b/src/music_kraken/recurse/__init__.py deleted file mode 100644 index 98e44a1..0000000 --- a/src/music_kraken/recurse/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from . import build - -Builder = build.Builder diff --git a/src/music_kraken/recurse/build.py b/src/music_kraken/recurse/build.py deleted file mode 100644 index 4f77447..0000000 --- a/src/music_kraken/recurse/build.py +++ /dev/null @@ -1,35 +0,0 @@ -from .. import objects - -class Builder: - @classmethod - def build_album(cls, album: objects.Album, traceback: set): - print(album.option_string) - if objects.Album in traceback: - return - traceback.add(objects.Album) - - for song in album.song_collection: - song.album_collection.append(album) - - @classmethod - def build_song(cls, song: objects.Song, traceback: set): - print(song.option_string) - if objects.Song in traceback: - return - traceback.add(objects.Song) - - for album in song.album_collection: - album.song_collection.append(song) - cls.build_album(album, traceback) - - for feature_artist in song.feature_artist_collection: - feature_artist.feature_song_collection.append(song) - - @classmethod - def build(cls, data_object: objects.MusicObject): - if isinstance(data_object, objects.Song): - cls.build_song(data_object, set()) - - if isinstance(data_object, objects.Album): - cls.build_album(data_object, set()) - \ No newline at end of file