The Lutris service can get its game installers on a thread too!

This commit is contained in:
Daniel Johnson 2024-01-13 08:26:04 -05:00 committed by Mathieu Comandon
parent c51ed54f89
commit 40c49b0f19

View file

@ -16,6 +16,7 @@ from lutris.gui.views.media_loader import download_media
from lutris.services.base import LutrisBanner, LutrisCoverart, LutrisCoverartMedium, LutrisIcon, OnlineService
from lutris.services.service_game import ServiceGame
from lutris.util import http
from lutris.util.jobs import AsyncCall
from lutris.util.log import logger
@ -122,11 +123,15 @@ class LutrisService(OnlineService):
return self.install_by_id(slug)
def install_by_id(self, appid):
installers = get_game_installers(appid) # appid is the slug for Lutris games
if not installers:
raise RuntimeError(_("Lutris has no installers for %s. Try using a different service instead.") % appid)
application = Gio.Application.get_default()
application.show_installer_window(installers)
def on_installers_ready(installers, error):
if error:
raise error # bounce any error off the backstop
if not installers:
raise RuntimeError(_("Lutris has no installers for %s. Try using a different service instead.") % appid)
application = Gio.Application.get_default()
application.show_installer_window(installers)
AsyncCall(get_game_installers, on_installers_ready, appid) # appid is the slug for Lutris games
def get_installed_runner_name(self, db_game):
platforms = self.get_game_platforms(db_game)