From 346d273201deb62ccb9bb2aeb8d45198065295a6 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Fri, 7 Jun 2024 11:17:47 +0200 Subject: [PATCH] feat: added extend --- music_kraken/objects/artwork.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/music_kraken/objects/artwork.py b/music_kraken/objects/artwork.py index a63129d..f98a106 100644 --- a/music_kraken/objects/artwork.py +++ b/music_kraken/objects/artwork.py @@ -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)