diff --git a/VERSION b/VERSION index 7e13abdf..3928541c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.3-develop1 +1.16.3-develop2 diff --git a/modules/builder.py b/modules/builder.py index 0aff35da..35afce34 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -335,14 +335,14 @@ class CollectionBuilder: if "sync_to_users" in methods or "sync_to_user" in methods: s_attr = f"sync_to_user{'s' if 'sync_to_users' in methods else ''}" logger.debug("") - logger.debug("Validating Method: sync_to_users") + logger.debug(f"Validating Method: {s_attr}") if self.data[methods[s_attr]]: - logger.warning(f"Playlist Error: sync_to_users attribute is blank defaulting to playlist_sync_to_user: {self.sync_to_users}") - else: logger.debug(f"Value: {self.data[methods[s_attr]]}") self.sync_to_users = self.data[methods[s_attr]] + else: + logger.warning(f"Playlist Error: sync_to_users attribute is blank defaulting to playlist_sync_to_users: {self.sync_to_users}") else: - logger.warning(f"Playlist Error: sync_to_users attribute not found defaulting to playlist_sync_to_user: {self.sync_to_users}") + logger.warning(f"Playlist Error: sync_to_users attribute not found defaulting to playlist_sync_to_users: {self.sync_to_users}") plex_users = self.library.users if self.sync_to_users: diff --git a/modules/meta.py b/modules/meta.py index bcfa3be8..ae1e8f98 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -1,4 +1,4 @@ -import math, operator, os, re +import math, operator, os, re, requests from datetime import datetime from modules import plex, ergast, util from modules.util import Failed, ImageData @@ -131,6 +131,9 @@ class DataFile: template_name = variables["name"] template = self.templates[template_name] + for key, value in variables.items(): + variables[f"{key}_encoded"] = requests.utils.quote(str(value)) + default = {} if "default" in template: if template["default"]: @@ -138,11 +141,12 @@ class DataFile: for dv in template["default"]: if str(dv) not in optional: if template["default"][dv] is not None: - final_value = str(template["default"][dv]) - for key in variables: - if f"<<{key}>>" in final_value: - final_value = final_value.replace(f"<<{key}>>", str(name)) + final_value = template["default"][dv] + for key, value in variables.items(): + if f"<<{key}>>" in str(final_value): + final_value = str(final_value).replace(f"<<{key}>>", str(value)) default[dv] = final_value + default[f"{dv}_encoded"] = requests.utils.quote(str(final_value)) else: raise Failed(f"{self.data_type} Error: template default sub-attribute {dv} is blank") else: @@ -155,6 +159,7 @@ class DataFile: for op in util.get_list(template["optional"]): if op not in default: optional.append(str(op)) + optional.append(f"{op}_encoded") else: logger.warning(f"Template Warning: variable {op} cannot be optional if it has a default") else: