continued musify scraper

This commit is contained in:
Hellow2
2023-03-16 14:36:49 +01:00
parent 9c438588a5
commit c43ff6df69
2 changed files with 117 additions and 41 deletions

View File

@@ -14,12 +14,15 @@ class DatabaseObject:
SIMPLE_ATTRIBUTES: tuple = tuple()
def __init__(self, _id: str = None, dynamic: bool = False, **kwargs) -> None:
self.automatic_id: bool = False
if _id is None and not dynamic:
"""
generates a random UUID
https://docs.python.org/3/library/uuid.html
"""
_id = str(uuid.uuid4())
self.automatic_id = True
LOGGER.debug(f"id for {type(self).__name__} isn't set. Setting to {_id}")
# The id can only be None, if the object is dynamic (self.dynamic = True)
@@ -71,6 +74,7 @@ class DatabaseObject:
if override or getattr(self, simple_attribute) is None:
setattr(self, simple_attribute, getattr(other, simple_attribute))
@property
def metadata(self) -> Metadata:
return Metadata()