Skip to content

Preserve hidden metadata values when reading from GUI form #693

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

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

mizaki
Copy link
Contributor

@mizaki mizaki commented Oct 3, 2024

Currently when write_tags is used, form_to_metadata is called within it which means any "hidden" values such as data-origin, identifier, price, rights, issue_id, series_id, is_version_of and last_mark are erased.

Some of these values are/may be of use to a tag plugin. (Saving the issue_is and series_id in ACBF for example.)

I'm not sure if doing it in the form_to_metadata will cause problems anywhere else? The other option I considered was to pull the values out in the write_tags method and then place them back after form_to_metadata.

@@ -940,6 +940,9 @@ def form_to_metadata(self) -> None:
md.add_credit(name, role, bool(primary_flag))

md.pages = self.page_list_editor.get_page_list()

# Preserve hidden md values
md.overlay(self.metadata, mode=comicapi.merge.Mode.ADD_MISSING, merge_lists=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't account for when someone wants to remove something, how would I remove the title from a comic that already has one set

@mizaki
Copy link
Contributor Author

mizaki commented Oct 4, 2024

I knew there was a reason why I rejected that way initially...

I've left it in the form_to_metadata method because apply_cbl_transform and auto_imprint could also wipe those values. Other instances of form_to_metadata shouldn't make a difference.

As the tag plugins now (I believe all?) receive the initial read data, it might be better to add price and identifier to the GUI and remove is_version_of, rights and last_mark from GenericMetadata (as a separate PR)?

@mizaki mizaki requested a review from lordwelch October 10, 2024 22:53
@lordwelch lordwelch merged commit 5df9359 into comictagger:develop Oct 19, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants