From 898ce5fdc73e4b186228fc69beb7a2ca6b80438e Mon Sep 17 00:00:00 2001 From: Theasacraft <91694323+Thesacraft@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:34:06 +0200 Subject: [PATCH] Update ts_qt.py to update badges if meta tag field is removed --- tagstudio/src/qt/ts_qt.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tagstudio/src/qt/ts_qt.py b/tagstudio/src/qt/ts_qt.py index 306fe857..78e2989d 100644 --- a/tagstudio/src/qt/ts_qt.py +++ b/tagstudio/src/qt/ts_qt.py @@ -2546,8 +2546,13 @@ class PreviewPanel(QWidget): entry = self.lib.get_entry(item_pair[1]) try: index = entry.fields.index(field) + updated_badges = False + if 8 in entry.fields[index].keys() and (1 in entry.fields[index][8] or 0 in entry.fields[index][8]): + updated_badges = True # TODO: Create a proper Library/Entry method to manage fields. entry.fields.pop(index) + if updated_badges: + self.driver.update_badges() except ValueError: logging.info(f'[PREVIEW PANEL][ERROR?] Tried to remove field from Entry ({entry.id}) that never had it') pass