Download the media for a duplicated game in the background; there's no need to wait.

This commit is contained in:
Daniel Johnson 2024-02-09 17:07:50 -05:00 committed by Mathieu Comandon
parent 53d0ed2c9c
commit 8b82adec43

View file

@ -22,6 +22,7 @@ from lutris.gui.dialogs.uninstall_game import UninstallMultipleGamesDialog
from lutris.gui.widgets.utils import open_uri
from lutris.services.lutris import download_lutris_media
from lutris.util import xdgshortcuts
from lutris.util.jobs import AsyncCall
from lutris.util.log import logger
from lutris.util.steam import shortcut as steam_shortcut
from lutris.util.strings import gtk_safe, slugify
@ -322,10 +323,13 @@ class GameActions(BaseGameActions):
db_game.pop("service_id", None)
game_id = add_game(**db_game)
download_lutris_media(db_game["slug"])
new_game = Game(game_id)
new_game.save()
# Download in the background; we'll update the LutrisWindow when this
# completes, no need to wait for it.
AsyncCall(download_lutris_media, None , db_game["slug"])
def on_edit_game_configuration(self, _widget):
"""Edit game preferences"""
for game in self.games: