From d2dedccc441e296fff70c8ac4fb328801dd3899f Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sun, 12 Sep 2021 23:38:22 -0400 Subject: [PATCH] #387 Fix for int collection name --- modules/meta.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/meta.py b/modules/meta.py index a93632ac..fdca9a16 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -18,19 +18,18 @@ class Metadata: logger.info("") logger.info(f"Loading Metadata {file_type}: {path}") def get_dict(attribute, attr_data, check_list=None): + if check_list is None: + check_list = [] if attr_data and attribute in attr_data: if attr_data[attribute]: if isinstance(attr_data[attribute], dict): - if check_list: - new_dict = {} - for a_name, a_data in attr_data[attribute].items(): - if a_name in check_list: - logger.error(f"Config Warning: Skipping duplicate {attribute[:-1] if attribute[-1] == 's' else attribute}: {a_name}") - else: - new_dict[a_name] = a_data - return new_dict - else: - return attr_data[attribute] + new_dict = {} + for a_name, a_data in attr_data[attribute].items(): + if a_name in check_list: + logger.error(f"Config Warning: Skipping duplicate {attribute[:-1] if attribute[-1] == 's' else attribute}: {a_name}") + else: + new_dict[str(a_name)] = a_data + return new_dict else: logger.warning(f"Config Warning: {attribute} must be a dictionary") else: