much progress
This commit is contained in:
@@ -96,7 +96,7 @@ class Collection:
|
||||
return AppendResult(True, existing_object, False)
|
||||
|
||||
# if the object does already exist
|
||||
# thus merging and don't add it afterwards
|
||||
# thus merging and don't add it afterward
|
||||
if merge_into_existing:
|
||||
existing_object.merge(element)
|
||||
# in case any relevant data has been added (e.g. it remaps the old object)
|
||||
|
@@ -11,6 +11,10 @@ class DatabaseObject:
|
||||
COLLECTION_ATTRIBUTES: tuple = tuple()
|
||||
SIMPLE_ATTRIBUTES: dict = dict()
|
||||
|
||||
# contains all collection attributes, which describe something "smaller"
|
||||
# e.g. album has songs, but not artist.
|
||||
DOWNWARDS_COLLECTION_ATTRIBUTES: tuple = tuple()
|
||||
|
||||
def __init__(self, _id: int = None, dynamic: bool = False, **kwargs) -> None:
|
||||
self.automatic_id: bool = False
|
||||
|
||||
|
@@ -204,6 +204,8 @@ class Album(MainObject):
|
||||
"notes": FormattedText()
|
||||
}
|
||||
|
||||
DOWNWARDS_COLLECTION_ATTRIBUTES = ("song_collection",)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
_id: int = None,
|
||||
@@ -422,6 +424,8 @@ class Artist(MainObject):
|
||||
"general_genre": ""
|
||||
}
|
||||
|
||||
DOWNWARDS_COLLECTION_ATTRIBUTES = ("feature_song_collection", "main_album_collection")
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
_id: int = None,
|
||||
@@ -646,6 +650,8 @@ class Label(MainObject):
|
||||
"notes": FormattedText()
|
||||
}
|
||||
|
||||
DOWNWARDS_COLLECTION_ATTRIBUTES = COLLECTION_ATTRIBUTES
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
_id: int = None,
|
||||
|
Reference in New Issue
Block a user