From 3f45d1f524c6c45d8b8613b9fe80259a82d12bef Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Mon, 8 Jan 2024 21:33:47 -0800 Subject: [PATCH] Only get service game if the game's service match --- lutris/gui/installerwindow.py | 2 +- lutris/gui/lutriswindow.py | 2 -- lutris/runner_interpreter.py | 5 ++++- lutris/services/base.py | 4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lutris/gui/installerwindow.py b/lutris/gui/installerwindow.py index 9dcfa2b0e..6c0edf3f0 100644 --- a/lutris/gui/installerwindow.py +++ b/lutris/gui/installerwindow.py @@ -21,11 +21,11 @@ from lutris.installer.errors import MissingGameDependencyError, ScriptingError from lutris.installer.interpreter import ScriptInterpreter from lutris.util import xdgshortcuts from lutris.util.jobs import AsyncCall +from lutris.util.linux import LINUX_SYSTEM from lutris.util.log import logger from lutris.util.steam import shortcut as steam_shortcut from lutris.util.strings import human_size from lutris.util.system import is_removeable -from lutris.util.linux import LINUX_SYSTEM class MarkupLabel(Gtk.Label): diff --git a/lutris/gui/lutriswindow.py b/lutris/gui/lutriswindow.py index 0d1873d3a..06a084048 100644 --- a/lutris/gui/lutriswindow.py +++ b/lutris/gui/lutriswindow.py @@ -1059,8 +1059,6 @@ class LutrisWindow(Gtk.ApplicationWindow, updated = self.game_store.update(db_game) if not updated: self.update_store() - else: - logger.debug("Can't get DB game for %s (service: %s)", game, self.service) return True diff --git a/lutris/runner_interpreter.py b/lutris/runner_interpreter.py index 1c708d2a7..96a2522fa 100644 --- a/lutris/runner_interpreter.py +++ b/lutris/runner_interpreter.py @@ -47,7 +47,10 @@ def get_launch_parameters(runner, gameplay_info): # MangoHud if runner.name == "steam": - logger.info("Do not enable Mangodhud for Steam games in Lutris. Edit the launch options in Steam and set them to mangohud %%command%%") + logger.info( + "Do not enable Mangodhud for Steam games in Lutris. " + "Edit the launch options in Steam and set them to mangohud %%command%%" + ) else: mango_args, mango_env = get_mangohud_conf(system_config) if mango_args: diff --git a/lutris/services/base.py b/lutris/services/base.py index 604db600f..a10b709a8 100644 --- a/lutris/services/base.py +++ b/lutris/services/base.py @@ -365,7 +365,9 @@ class BaseService(GObject.Object): def get_service_db_game(self, game: Game): """Returns the row dictionary for the service-game corresponding to the PGA game given, if any, or None.""" - return ServiceGameCollection.get_game(self.id, game.appid) + if game.service == self.id and game.appid: + return ServiceGameCollection.get_game(self.id, game.appid) + return None class OnlineService(BaseService):