more template fixes

This commit is contained in:
meisnate12 2022-01-06 15:46:37 -05:00
parent 7076448541
commit 5d21421eda

View file

@ -93,11 +93,15 @@ class DataFile:
elif not isinstance(self.templates[variables["name"]], dict):
raise Failed(f"{self.data_type} Error: template {variables['name']} is not a dictionary")
else:
optional = []
remove_variables = []
for tm in variables:
if variables[tm] is None:
optional.append(str(tm))
variables.pop(tm)
remove_variables.append(tm)
optional = []
for remove_variable in remove_variables:
variables.pop(remove_variable)
optional.append(str(remove_variable))
if self.data_type == "Collection" and "collection_name" not in variables:
variables["collection_name"] = str(name)
if self.data_type == "Playlist" and "playlist_name" not in variables: