From 78a094d0cea60f722d857b5f2d6fd07966daf9b0 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Mon, 19 Jul 2021 11:24:55 -0700 Subject: [PATCH] Fix row matching --- lutris/gui/lutriswindow.py | 7 ++----- lutris/gui/views/store.py | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lutris/gui/lutriswindow.py b/lutris/gui/lutriswindow.py index e4feceb76..5f52b0a16 100644 --- a/lutris/gui/lutriswindow.py +++ b/lutris/gui/lutriswindow.py @@ -781,13 +781,10 @@ class LutrisWindow(Gtk.ApplicationWindow): # pylint: disable=too-many-public-me return False def on_game_updated(self, game): - if not self.service: - db_game = games_db.get_game_by_field(game.id, "id") - elif game.appid: + if game.appid and self.service: db_game = ServiceGameCollection.get_game(self.service.id, game.appid) else: - logger.debug("%s not found", game) - return True + db_game = games_db.get_game_by_field(game.id, "id") updated = self.game_store.update(db_game) if not updated: self.game_store.add_game(db_game) diff --git a/lutris/gui/views/store.py b/lutris/gui/views/store.py index 32b9faa2c..92da4255d 100644 --- a/lutris/gui/views/store.py +++ b/lutris/gui/views/store.py @@ -12,6 +12,7 @@ from lutris.gui.views.store_item import StoreItem from lutris.gui.widgets.utils import get_pixbuf from lutris.util.strings import gtk_safe + from . import ( COL_ICON, COL_ID, COL_INSTALLED, COL_INSTALLED_AT, COL_INSTALLED_AT_TEXT, COL_LASTPLAYED, COL_LASTPLAYED_TEXT, COL_NAME, COL_PLATFORM, COL_PLAYTIME, COL_PLAYTIME_TEXT, COL_RUNNER, COL_RUNNER_HUMAN_NAME, COL_SLUG, COL_YEAR @@ -109,7 +110,7 @@ class GameStore(GObject.Object): return for model_row in self.store: try: - if model_row[COL_ID] == _id: + if model_row[COL_ID] == str(_id): return model_row except TypeError: return