started fetching of album details

This commit is contained in:
Hellow2 2023-03-20 17:03:14 +01:00
parent 718c911c81
commit 96f2d7ef6e
3 changed files with 1215 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -564,7 +564,7 @@ class Musify(Page):
album_source: Source album_source: Source
if not flat: if not flat:
for album_source in new_album.source_collection.get_sources_from_page(cls.SOURCE_TYPE): for album_source in new_album.source_collection.get_sources_from_page(cls.SOURCE_TYPE):
new_album.merge(cls.get_album_from_source(album_source)) new_album.merge(cls.fetch_album_from_source(album_source))
discography.append(new_album) discography.append(new_album)
@ -727,5 +727,15 @@ class Musify(Page):
return artist return artist
@classmethod @classmethod
def get_album_from_source(cls, source: Source, flat: bool = False) -> Album: def fetch_album_from_source(cls, source: Source, flat: bool = False) -> Album:
return Album() """_summary_
Args:
source (Source): _description_
flat (bool, optional): _description_. Defaults to False.
Returns:
Album: _description_
"""
return Album(title="works")

View File

@ -15,6 +15,14 @@ def fetch_artist():
artist = Musify.fetch_details(artist) artist = Musify.fetch_details(artist)
print(artist.options) print(artist.options)
def fetch_album():
album = objects.Album(
source_list=[objects.Source(objects.SourcePages.MUSIFY, "https://musify.club/release/linkin-park-hybrid-theory-2000-188")]
)
album = Musify.fetch_details(album)
print(album.options)
if __name__ == "__main__": if __name__ == "__main__":
fetch_artist() fetch_album()