Add heuristics to predict the runner for Lutris service games

Pretty simple; if there's just one platform, and it is Windows or Linux or MS-DOS, we guess 'wine' or 'linux' or 'dosbox'; otherwise we just give up.

Sadly most Lutris service games seem to have multiple platforms. Darn you, portability, darn you to heck!

We can tweak this to be more opinionated later, if desired.
This commit is contained in:
Daniel Johnson 2023-11-10 07:30:17 -05:00
parent fc4753464a
commit d0a45f17bf

View file

@ -126,6 +126,23 @@ class LutrisService(OnlineService):
application = Gio.Application.get_default()
application.show_installer_window(installers)
def get_installed_runner_name(self, db_game):
platforms = self.get_game_platforms(db_game)
if platforms and len(platforms) == 1:
platform = platforms[0].casefold()
if platform == "windows":
return "wine"
if platform == "linux":
return "linux"
if platform == "ms-dos":
return "dosbox"
return ""
def get_game_platforms(self, db_game):
details = db_game.get("details")
if details: