[17] fix dynamic errors

pull/811/head
meisnate12 3 years ago
parent c30a731da8
commit 81b6dd05dc

@ -1 +1 @@
1.16.2-develop16 1.16.2-develop17

@ -422,8 +422,8 @@ class MetadataFile(DataFile):
template_name = util.parse("Config", "template", dynamic, parent=map_name, methods=methods) template_name = util.parse("Config", "template", dynamic, parent=map_name, methods=methods)
if template_name not in self.templates: if template_name not in self.templates:
raise Failed(f"Config Error: {map_name} template: {template_name} not found") raise Failed(f"Config Error: {map_name} template: {template_name} not found")
if f"<<{auto_type}>>" not in str(self.templates[template_name]): if "<<value>>" not in str(self.templates[template_name]) and f"<<{auto_type}>>" not in str(self.templates[template_name]):
raise Failed(f"Config Error: {map_name} template: {template_name} is required to have the template variable <<{auto_type}>>") raise Failed(f"Config Error: {map_name} template: {template_name} is required to have the template variable <<value>>")
else: else:
self.templates[map_name] = default_template if default_template else default_templates[auto_type] self.templates[map_name] = default_template if default_template else default_templates[auto_type]
template_name = map_name template_name = map_name

@ -1002,7 +1002,8 @@ class Plex(Library):
if isinstance(item, (Movie, Show)) and not poster and overlay: if isinstance(item, (Movie, Show)) and not poster and overlay:
self.upload_images(item, overlay=overlay) self.upload_images(item, overlay=overlay)
if create and folders and not found_folder: if create and folders and not found_folder:
found_folder = os.path.join(self.asset_directory[0], name) filename, _ = util.validate_filename(name)
found_folder = os.path.join(self.asset_directory[0], filename)
os.makedirs(found_folder, exist_ok=True) os.makedirs(found_folder, exist_ok=True)
logger.info(f"Asset Directory Created: {found_folder}") logger.info(f"Asset Directory Created: {found_folder}")
elif isinstance(item, (Movie, Show)) and not overlay and folders and not found_folder: elif isinstance(item, (Movie, Show)) and not overlay and folders and not found_folder:

Loading…
Cancel
Save