mirror of
https://github.com/lutris/lutris
synced 2024-10-06 15:59:39 +00:00
The Lutris service can get its game installers on a thread too!
This commit is contained in:
parent
c51ed54f89
commit
40c49b0f19
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue