[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)
if template_name not in self.templates:
raise Failed(f"Config Error: {map_name} template: {template_name} not found")
if 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}>>")
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 <<value>>")
else:
self.templates[map_name] = default_template if default_template else default_templates[auto_type]
template_name = map_name

@ -1002,7 +1002,8 @@ class Plex(Library):
if isinstance(item, (Movie, Show)) and not poster and overlay:
self.upload_images(item, overlay=overlay)
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)
logger.info(f"Asset Directory Created: {found_folder}")
elif isinstance(item, (Movie, Show)) and not overlay and folders and not found_folder:

Loading…
Cancel
Save