mirror of
https://github.com/lutris/lutris
synced 2024-10-02 22:14:23 +00:00
Fix row matching
This commit is contained in:
parent
6a5aa609d9
commit
78a094d0ce
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue