|
|
@ -202,33 +202,31 @@ class CollectionBuilder:
|
|
|
|
|
|
|
|
|
|
|
|
logger.separator(f"Validating {self.mapping_name} Attributes", space=False, border=False)
|
|
|
|
logger.separator(f"Validating {self.mapping_name} Attributes", space=False, border=False)
|
|
|
|
|
|
|
|
|
|
|
|
if "name" in methods:
|
|
|
|
if f"{self.type}_name" in methods:
|
|
|
|
name = self.data[methods["name"]]
|
|
|
|
|
|
|
|
elif f"{self.type}_name" in methods:
|
|
|
|
|
|
|
|
logger.warning(f"Config Warning: Running {self.type}_name as name")
|
|
|
|
logger.warning(f"Config Warning: Running {self.type}_name as name")
|
|
|
|
name = self.data[methods[f"{self.type}_name"]]
|
|
|
|
self.data["name"] = self.data[methods[f"{self.type}_name"]]
|
|
|
|
else:
|
|
|
|
methods["name"] = "name"
|
|
|
|
name = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if name:
|
|
|
|
|
|
|
|
logger.debug("")
|
|
|
|
|
|
|
|
logger.debug("Validating Method: name")
|
|
|
|
|
|
|
|
if not name:
|
|
|
|
|
|
|
|
raise Failed(f"{self.Type} Error: name attribute is blank")
|
|
|
|
|
|
|
|
logger.debug(f"Value: {name}")
|
|
|
|
|
|
|
|
self.name = str(name)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
self.name = str(self.mapping_name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "template" in methods:
|
|
|
|
if "template" in methods:
|
|
|
|
logger.debug("")
|
|
|
|
logger.debug("")
|
|
|
|
logger.debug("Validating Method: template")
|
|
|
|
logger.debug("Validating Method: template")
|
|
|
|
new_attributes = self.metadata.apply_template(self.name, self.data, self.data[methods["template"]])
|
|
|
|
name = self.data[methods["name"]] if "name" in methods else None
|
|
|
|
|
|
|
|
new_attributes = self.metadata.apply_template(name, self.mapping_name, self.data, self.data[methods["template"]])
|
|
|
|
for attr in new_attributes:
|
|
|
|
for attr in new_attributes:
|
|
|
|
if attr.lower() not in methods:
|
|
|
|
if attr.lower() not in methods:
|
|
|
|
self.data[attr] = new_attributes[attr]
|
|
|
|
self.data[attr] = new_attributes[attr]
|
|
|
|
methods[attr.lower()] = attr
|
|
|
|
methods[attr.lower()] = attr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "name" in methods:
|
|
|
|
|
|
|
|
logger.debug("")
|
|
|
|
|
|
|
|
logger.debug("Validating Method: name")
|
|
|
|
|
|
|
|
if not self.data[methods["name"]]:
|
|
|
|
|
|
|
|
raise Failed(f"{self.Type} Error: name attribute is blank")
|
|
|
|
|
|
|
|
logger.debug(f"Value: {self.data[methods['name']]}")
|
|
|
|
|
|
|
|
self.name = str(self.data[methods["name"]])
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
self.name = None
|
|
|
|
|
|
|
|
|
|
|
|
if "allowed_library_types" in methods and not self.playlist:
|
|
|
|
if "allowed_library_types" in methods and not self.playlist:
|
|
|
|
logger.debug("")
|
|
|
|
logger.debug("")
|
|
|
|
logger.debug("Validating Method: allowed_library_types")
|
|
|
|
logger.debug("Validating Method: allowed_library_types")
|
|
|
|