diff --git a/src/music_kraken/objects/collection.py b/src/music_kraken/objects/collection.py index f066103..700d961 100644 --- a/src/music_kraken/objects/collection.py +++ b/src/music_kraken/objects/collection.py @@ -60,7 +60,7 @@ class Collection: if unified in self._by_attribute[name]: return self._by_attribute[name][unified] - def append(self, element: SourceAttribute): + def append(self, element: SourceAttribute, merge_on_conflict: bool = True): if type(element) is not self.element_type and self.element_type is not None: raise TypeError(f"{type(element)} is not the set type {self.element_type}") diff --git a/src/music_kraken/objects/parents.py b/src/music_kraken/objects/parents.py index 9f219dc..74819ff 100644 --- a/src/music_kraken/objects/parents.py +++ b/src/music_kraken/objects/parents.py @@ -7,6 +7,9 @@ from ..utils.shared import ( class DatabaseObject: + COLLECTION_ATTRIBUTES: tuple = tuple() + SIMPLE_ATTRIBUTES: tuple = tuple() + def __init__(self, _id: str = None, dynamic: bool = False, **kwargs) -> None: if _id is None and not dynamic: """ @@ -20,6 +23,9 @@ class DatabaseObject: self.id: Optional[str] = _id self.dynamic = dynamic + + def merge(self, other, override: bool = False): + for collection in class MainObject(DatabaseObject): @@ -33,6 +39,7 @@ class MainObject(DatabaseObject): It has all the functionality of the "DatabaseObject" (it inherits from said class) but also some added functions as well. """ + def __init__(self, _id: str = None, dynamic: bool = False, **kwargs): super().__init__(_id=_id, dynamic=dynamic, **kwargs)