From e179bf2f2ed81d5720f8282115966199f57e710b Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Mon, 7 Sep 2026 18:16:20 -0400 Subject: [PATCH] library: refresh scraped cover in grid even when items were rebuilt refresh_item matched the grid row by object identity, which silently fails when the library list was rebuilt (background scan/store refresh) while the scrape dialog was open. Match by release_id + system as a fallback, like update_item_label already does, so the cover tile updates without a Reload. --- app/gui.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/gui.py b/app/gui.py index 62f8dac..7db85a7 100644 --- a/app/gui.py +++ b/app/gui.py @@ -494,9 +494,17 @@ class CoverShowcase(QWidget): pm = QPixmap(str(path)) if pm.isNull(): return + # Match by identity when possible, falling back to release_id/system + # equality (the library may have been rebuilt while the scrape dialog + # was open, replacing the item objects). for i in range(self.list.count()): item = self.list.item(i) - if item.data(Qt.UserRole) is it: + data = item.data(Qt.UserRole) + if data is it or ( + data is not None + and data.get("release_id") == it.get("release_id") + and (data.get("system") or "games") == system + ): item.setIcon(self._fit_icon(pm)) if i in self.missing: self.missing.remove(i)