This commit is contained in:
Hellow2 2023-03-14 13:36:05 +01:00
parent f858b97a17
commit 4a199547de
2 changed files with 10 additions and 5 deletions

View File

@ -6,11 +6,10 @@ from music_kraken.pages import (
) )
results = EncyclopaediaMetallum.search_by_query("#a Happy Days") results = EncyclopaediaMetallum.search_by_query("#a Ghost Bath")
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

@ -103,13 +103,19 @@ class Page:
""" """
if type(music_object) == Song: if type(music_object) == Song:
return cls.fetch_song_details(music_object, flat=flat) song = cls.fetch_song_details(music_object, flat=flat)
song.compile()
return song
if type(music_object) == Album: if type(music_object) == Album:
return cls.fetch_album_details(music_object, flat=flat) album = cls.fetch_album_details(music_object, flat=flat)
album.compile()
return album
if type(music_object) == Artist: if type(music_object) == Artist:
return cls.fetch_artist_details(music_object, flat=flat) artist = cls.fetch_artist_details(music_object, flat=flat)
artist.compile()
return artist
raise NotImplementedError(f"MusicObject {type(music_object)} has not been implemented yet") raise NotImplementedError(f"MusicObject {type(music_object)} has not been implemented yet")