From 41a265a22f3ada1e87db3ba53d189315e61ec25b Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Fri, 6 Oct 2023 17:44:49 +0200 Subject: [PATCH] ScummVM - Re-Read config file before installation because the path is not stored in database --- lutris/services/scummvm.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lutris/services/scummvm.py b/lutris/services/scummvm.py index 0582a1cf2..8bc8d9495 100644 --- a/lutris/services/scummvm.py +++ b/lutris/services/scummvm.py @@ -31,16 +31,14 @@ class ScummvmService(BaseService): "icon": ScummvmBanner } - game_paths = None - - def load(self): + def get_games(self): if not os.path.isfile(SCUMMVM_CONFIG_FILE): - return + return None config = ConfigParser() config.read(SCUMMVM_CONFIG_FILE) config_sections = config.sections() - self.game_paths = {} + games = {} for section in config_sections: if section == "scummvm": @@ -54,11 +52,20 @@ class ScummvmService(BaseService): game.lutris_slug = game.slug game.details = config[section]["description"] game.path = config[section]["path"] - self.game_paths[game.slug] = game.path + games[game.slug] = game - game.save() + return games + + def load(self): + games = self.get_games() + if games is not None: + for slug in games: + games[slug].save() def generate_installer(self, game): + games = self.get_games() + game_data = games.get(game["slug"]) + return { "name": game["name"], "version": "ScummVM", @@ -68,7 +75,7 @@ class ScummvmService(BaseService): "script": { "game": { "game_id": game["appid"], - "path": self.game_paths[game["slug"]], + "path": game_data.path, "platform": "scummvm" } }