Work on Retroarch Steam executable

This commit is contained in:
GeoffreyCoulaud
2023-08-13 19:18:54 +02:00
parent c2c998adcd
commit 86ac95641c

View File

@@ -26,8 +26,6 @@ from pathlib import Path
from time import time from time import time
from typing import NamedTuple from typing import NamedTuple
from urllib.parse import quote
from src import shared from src import shared
from src.errors.friendly_error import FriendlyError from src.errors.friendly_error import FriendlyError
from src.game import Game from src.game import Game
@@ -223,13 +221,20 @@ class RetroarchSource(Source):
""" """
self.locations.config.resolve() self.locations.config.resolve()
args = f'-L "{core_path}" "{rom_path}"' args = f"-L '{core_path}' '{rom_path}'"
# Steam RetroArch # Steam RetroArch
# (Must check before Flatpak, because Steam itself can be installed as one) # (Must check before Flatpak, because Steam itself can be installed as one)
if self.locations.config.root.parent.parent.name == "steamapps": if self.locations.config.root.parent.parent.name == "steamapps":
uri = "steam://run/1118310//" + quote(args) + "/" # TODO fix the RetroArch Steam arguments
return f"xdg-open {uri}" # 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 # Flatpak RetroArch
if self.locations.config.root.is_relative_to(shared.flatpak_dir): if self.locations.config.root.is_relative_to(shared.flatpak_dir):