[25] fix decade dynamic collections

This commit is contained in:
meisnate12 2022-11-17 01:38:58 -05:00
parent 7e09295f78
commit f853209790
3 changed files with 4 additions and 4 deletions

View file

@ -1 +1 @@
1.18.0-develop24
1.18.0-develop25

View file

@ -645,8 +645,8 @@ class MetadataFile(DataFile):
decade = str(int(math.floor(item.year / 10) * 10))
if decade not in addons:
addons[decade] = []
if item.year not in addons[decade]:
addons[decade].append(item.year)
if str(item.year) not in addons[decade]:
addons[decade].append(str(item.year))
all_keys[str(item.year)] = str(item.year)
auto_list = {str(k): f"{k}s" for k in addons if str(k) not in exclude and f"{k}s" not in exclude}
default_template = {"smart_filter": {"limit": 50, "sort_by": "critic_rating.desc", "any": {"year": "<<value>>"}}}

View file

@ -809,7 +809,7 @@ class Operations:
logger.error(f"Backup failed to load saving copy to {filename}{i}{file_extension}")
if not yaml:
yaml = YAML(path=self.library.metadata_backup["path"], create=True)
if "metadata" not in yaml.data:
if "metadata" not in yaml.data or not isinstance(yaml.data["metadata"], dict):
yaml.data["metadata"] = {}
special_names = {}
for mk, mv in yaml.data["metadata"].items():