Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add match to metadata_backup operation #1912

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/operations.py
Expand Up @@ -1143,6 +1143,11 @@ def get_batch_info(placement, total, display_attr, total_count, display_value=No
map_key, attrs = self.library.get_locked_attributes(item, titles, year_titles)
if map_key in special_names:
map_key = special_names[map_key]
if map_key not in yaml.data["metadata"]:
yaml.data["metadata"][map_key] = {"match": {}}
yaml.data["metadata"][map_key]["match"]["title"] = item.title
yaml.data["metadata"][map_key]["match"]["year"] = item.year

og_dict = yaml.data["metadata"][map_key] if map_key in yaml.data["metadata"] and yaml.data["metadata"][map_key] and isinstance(yaml.data["metadata"][map_key], dict) else {}
if attrs or (self.library.metadata_backup["add_blank_entries"] and not og_dict):

Expand Down