Fix row matching

This commit is contained in:
Mathieu Comandon 2021-07-19 11:24:55 -07:00
parent 6a5aa609d9
commit 78a094d0ce
2 changed files with 4 additions and 6 deletions

View file

@ -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)

View file

@ -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