feat: made the artwork mergable
This commit is contained in:
parent
25c20a7ef3
commit
1bb9fd6d9c
@ -41,3 +41,8 @@ class Artwork:
|
|||||||
@property
|
@property
|
||||||
def best_variant(self) -> ArtworkVariant:
|
def best_variant(self) -> ArtworkVariant:
|
||||||
return min(self._variant_mapping.values(), key=lambda x: x["deviation"])
|
return min(self._variant_mapping.values(), key=lambda x: x["deviation"])
|
||||||
|
|
||||||
|
def __merge__(self, other: Artwork, override: bool = False) -> None:
|
||||||
|
for key, value in other._variant_mapping.items():
|
||||||
|
if key not in self._variant_mapping or override:
|
||||||
|
self._variant_mapping[key] = value
|
||||||
|
Loading…
Reference in New Issue
Block a user