[25] fix decade dynamic collections

pull/1199/head
meisnate12 2 years ago
parent 7e09295f78
commit f853209790

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

@ -645,8 +645,8 @@ class MetadataFile(DataFile):
decade = str(int(math.floor(item.year / 10) * 10)) decade = str(int(math.floor(item.year / 10) * 10))
if decade not in addons: if decade not in addons:
addons[decade] = [] addons[decade] = []
if item.year not in addons[decade]: if str(item.year) not in addons[decade]:
addons[decade].append(item.year) addons[decade].append(str(item.year))
all_keys[str(item.year)] = 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} 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>>"}}} default_template = {"smart_filter": {"limit": 50, "sort_by": "critic_rating.desc", "any": {"year": "<<value>>"}}}

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

Loading…
Cancel
Save