[17] fix dynamic errors

This commit is contained in:
meisnate12 2022-03-22 09:01:29 -04:00
parent c30a731da8
commit 81b6dd05dc
3 changed files with 5 additions and 4 deletions

View file

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

View file

@ -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

View file

@ -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: