feature/artwork_gallery #41

Merged
Hazel merged 25 commits from feature/artwork_gallery into experimental 2024-07-15 09:36:22 +00:00
Showing only changes of commit 346d273201 - Show all commits

View File

@ -89,6 +89,7 @@ class ArtworkCollection:
self.crop_images: bool = crop_images
self._data = []
self.extend(data)
def search_artwork(self, url: str) -> Optional[ArtworkVariant]:
for artwork in self._data:
@ -128,6 +129,10 @@ class ArtworkCollection:
if isinstance(value, Artwork):
self._data.append(value)
return
def extend(self, values: List[Union[Artwork, ArtworkVariant, dict]], **kwargs):
for value in values:
self.append(value, **kwargs)
def __merge__(self, other: ArtworkCollection, **kwargs) -> None:
self.parent_artworks.update(other.parent_artworks)