feat: added recursive structure
This commit is contained in:
@@ -117,7 +117,7 @@ class Bandcamp(Page):
|
||||
return Song(
|
||||
title=clean_song_title(name, artist_name=data["band_name"]),
|
||||
source_list=source_list,
|
||||
main_artist_list=[
|
||||
artist_list=[
|
||||
Artist(
|
||||
name=data["band_name"],
|
||||
source_list=[
|
||||
@@ -370,7 +370,7 @@ class Bandcamp(Page):
|
||||
date=ID3Timestamp.strptime(data["datePublished"], "%d %b %Y %H:%M:%S %Z"),
|
||||
source_list=[Source(self.SOURCE_TYPE, album_data["@id"])]
|
||||
)],
|
||||
main_artist_list=[Artist(
|
||||
artist_list=[Artist(
|
||||
name=artist_data["name"].strip(),
|
||||
source_list=[Source(self.SOURCE_TYPE, _parse_artist_url(artist_data["@id"]))]
|
||||
)],
|
||||
|
@@ -52,7 +52,7 @@ def _song_from_json(artist_html=None, album_html=None, release_type=None, title=
|
||||
|
||||
return Song(
|
||||
title=title,
|
||||
main_artist_list=[
|
||||
artist_list=[
|
||||
_artist_from_json(artist_html=artist_html)
|
||||
],
|
||||
album_list=[
|
||||
|
@@ -143,7 +143,7 @@ class YouTube(SuperYouTube):
|
||||
self.SOURCE_TYPE, get_invidious_url(path="/watch", query=f"v={data['videoId']}")
|
||||
)],
|
||||
notes=FormattedText(html=data["descriptionHtml"] + f"\n<p>{license_str}</ p>" ),
|
||||
main_artist_list=artist_list
|
||||
artist_list=artist_list
|
||||
), int(data["published"])
|
||||
|
||||
def fetch_song(self, source: Source, stop_at_level: int = 1) -> Song:
|
||||
@@ -284,7 +284,7 @@ class YouTube(SuperYouTube):
|
||||
self.LOGGER.warning(f"didn't found any playlists with piped, falling back to invidious. (it is unusual)")
|
||||
album_list, artist_name = self.fetch_invidious_album_list(parsed.id)
|
||||
|
||||
return Artist(name=artist_name, main_album_list=album_list, source_list=[source])
|
||||
return Artist(name=artist_name, album_list=album_list, source_list=[source])
|
||||
|
||||
def download_song_to_target(self, source: Source, target: Target, desc: str = None) -> DownloadResult:
|
||||
"""
|
||||
|
@@ -58,6 +58,19 @@ def music_responsive_list_item_renderer(renderer: dict) -> List[DatabaseObject]:
|
||||
song.album_collection.extend(album_list)
|
||||
return [song]
|
||||
|
||||
if len(album_list) == 1:
|
||||
album = album_list[0]
|
||||
album.artist_collection.extend(artist_list)
|
||||
album.song_collection.extend(song_list)
|
||||
return [album]
|
||||
|
||||
"""
|
||||
if len(artist_list) == 1:
|
||||
artist = artist_list[0]
|
||||
artist.main_album_collection.extend(album_list)
|
||||
return [artist]
|
||||
"""
|
||||
|
||||
return results
|
||||
|
||||
|
||||
|
@@ -639,7 +639,7 @@ class YoutubeMusic(SuperYouTube):
|
||||
album_list=album_list,
|
||||
length=int(ydl_res.get("duration", 0)) * 1000,
|
||||
artwork=Artwork(*ydl_res.get("thumbnails", [])),
|
||||
main_artist_list=artist_list,
|
||||
artist_list=artist_list,
|
||||
source_list=[Source(
|
||||
self.SOURCE_TYPE,
|
||||
f"https://music.youtube.com/watch?v={ydl_res.get('id')}"
|
||||
|
Reference in New Issue
Block a user