From 5d21421eda7fc90da6415461a57cc6f5e70eac1f Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 6 Jan 2022 15:46:37 -0500 Subject: [PATCH] more template fixes --- modules/meta.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/meta.py b/modules/meta.py index 1272f279..00b6b1f0 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -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: