[9] fix None error in metadata_backup

pull/779/head
meisnate12 3 years ago
commit a9cf581a42

@ -1 +1 @@
1.16.1-develop8
1.16.1-develop9

@ -743,7 +743,7 @@ def library_operations(config, library):
logger.info("")
logger.info(f"Metadata Backup Path: {library.metadata_backup['path']}")
logger.info("")
meta = {}
meta = None
if os.path.exists(library.metadata_backup["path"]):
try:
meta, _, _ = yaml.util.load_yaml_guess_indent(open(library.metadata_backup["path"]))
@ -755,6 +755,8 @@ def library_operations(config, library):
i += 1
os.rename(library.metadata_backup["path"], f"{filename}{i}{file_extension}")
logger.error(f"Backup failed to load saving copy to {filename}{i}{file_extension}")
if not meta:
meta = {}
if "metadata" not in meta:
meta["metadata"] = {}
items = library.get_all(load=True)

Loading…
Cancel
Save