feat: tried improving fetching
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
e9b1a12aa1
commit
a3ef671f00
@ -145,6 +145,9 @@ class Collection(Generic[T]):
|
||||
existing_object.merge(__object, **kwargs)
|
||||
self._map_element(existing_object)
|
||||
|
||||
def contains(self, __object: T) -> bool:
|
||||
return self._find_object(__object) is not None
|
||||
|
||||
def extend(self, __iterable: Optional[Generator[T, None, None]], **kwargs):
|
||||
if __iterable is None:
|
||||
return
|
||||
|
@ -56,15 +56,24 @@ def music_responsive_list_item_renderer(renderer: dict) -> List[DatabaseObject]:
|
||||
|
||||
for song in song_list:
|
||||
song.album_collection.extend(album_list)
|
||||
song.main_artist_collection.extend(artist_list)
|
||||
|
||||
for artist in artist_list:
|
||||
existing_artist = song.main_artist_collection._find_object(artist)
|
||||
|
||||
if existing_artist is None:
|
||||
song.feature_artist_collection.append(artist)
|
||||
else:
|
||||
existing_artist.merge(artist)
|
||||
|
||||
if len(song_list) > 0:
|
||||
return song_list
|
||||
|
||||
for album in album_list:
|
||||
album.artist_collection.extend(artist_list)
|
||||
|
||||
if len(song_list) > 0:
|
||||
return song_list
|
||||
if len(album_list) > 0:
|
||||
return album_list
|
||||
|
||||
if len(artist_list) > 0:
|
||||
return artist_list
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user