made better

This commit is contained in:
Hellow2 2023-03-14 12:02:58 +01:00
parent 4056c736b9
commit f858b97a17
4 changed files with 3 additions and 43 deletions

View File

@ -60,8 +60,4 @@ song = objects.Song(
song.compile() song.compile()
print(song.option_string) print(song.options)
for album in song.album_collection:
print(album.option_string)
for artist in song.main_artist_collection:
print(artist.option_string)

View File

@ -10,5 +10,7 @@ results = EncyclopaediaMetallum.search_by_query("#a Happy Days")
artist = results[0] artist = results[0]
artist: objects.Artist = EncyclopaediaMetallum.fetch_details(artist) artist: objects.Artist = EncyclopaediaMetallum.fetch_details(artist)
artist.compile()
print(artist.options) print(artist.options)
print() print()

View File

@ -1,3 +0,0 @@
from . import build
Builder = build.Builder

View File

@ -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())