From c33d0203e458e3da5662825e5fe4cc75f8ca3fe2 Mon Sep 17 00:00:00 2001 From: DandyDev01 <37933054+DandyDev01@users.noreply.github.com> Date: Sat, 14 Dec 2024 12:40:48 -0700 Subject: [PATCH] fix: editing tags from preview panel updates database (#641) * fix: bug where preview_panel tag was out of date compared to tag in database after edits where made using the tagDatabasePanel * fix: changes made in the preview panel are saved to the database --- tagstudio/src/qt/ts_qt.py | 6 +++++- tagstudio/src/qt/widgets/tag_box.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tagstudio/src/qt/ts_qt.py b/tagstudio/src/qt/ts_qt.py index a16f89107..0f7f2a270 100644 --- a/tagstudio/src/qt/ts_qt.py +++ b/tagstudio/src/qt/ts_qt.py @@ -656,7 +656,11 @@ def clear_select_action_callback(self): def show_tag_database(self): self.modal = PanelModal( - TagDatabasePanel(self.lib), "Library Tags", "Library Tags", has_save=False + widget=TagDatabasePanel(self.lib), + title="Library Tags", + window_title="Library Tags", + done_callback=self.preview_panel.update_widgets, + has_save=False, ) self.modal.show() diff --git a/tagstudio/src/qt/widgets/tag_box.py b/tagstudio/src/qt/widgets/tag_box.py index a1c7301ba..a26ec33af 100755 --- a/tagstudio/src/qt/widgets/tag_box.py +++ b/tagstudio/src/qt/widgets/tag_box.py @@ -139,7 +139,9 @@ def edit_tag(self, tag: Tag): self.edit_modal.saved.connect( lambda: self.driver.lib.update_tag( build_tag_panel.build_tag(), - subtag_ids=build_tag_panel.subtag_ids, + subtag_ids=set(build_tag_panel.subtag_ids), + alias_names=set(build_tag_panel.alias_names), + alias_ids=set(build_tag_panel.alias_ids), ) ) self.edit_modal.show()