From 86ac95641ca6717666aaf54e2760ff4d84928b36 Mon Sep 17 00:00:00 2001 From: GeoffreyCoulaud Date: Sun, 13 Aug 2023 19:18:54 +0200 Subject: [PATCH] Work on Retroarch Steam executable --- src/importer/sources/retroarch_source.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/importer/sources/retroarch_source.py b/src/importer/sources/retroarch_source.py index b5dc4fb..7556f86 100644 --- a/src/importer/sources/retroarch_source.py +++ b/src/importer/sources/retroarch_source.py @@ -26,8 +26,6 @@ from pathlib import Path from time import time from typing import NamedTuple -from urllib.parse import quote - from src import shared from src.errors.friendly_error import FriendlyError from src.game import Game @@ -223,13 +221,20 @@ class RetroarchSource(Source): """ self.locations.config.resolve() - args = f'-L "{core_path}" "{rom_path}"' + args = f"-L '{core_path}' '{rom_path}'" # Steam RetroArch # (Must check before Flatpak, because Steam itself can be installed as one) if self.locations.config.root.parent.parent.name == "steamapps": - uri = "steam://run/1118310//" + quote(args) + "/" - return f"xdg-open {uri}" + # TODO fix the RetroArch Steam arguments + # It seems that the space after "-L" is parsed as the value for that arg. + # The URI protocol is proprietary, a community doc is available: + # https://developer.valvesoftware.com/wiki/Steam_browser_protocol + # ... But it doesn't sepcify HOW the args should be formatted. + # Space delimited? Quoted individually? URL-Encoded? + # I don't know. It no workie :D + uri = f"steam://run/1118310//{args}/" + return f'xdg-open "{uri}"' # Flatpak RetroArch if self.locations.config.root.is_relative_to(shared.flatpak_dir):