Fix for RetroArch Steam not found
This commit is contained in:
@@ -178,13 +178,23 @@ class RetroarchSource(Source):
|
|||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.locations.config.candidates.append(self.get_steam_location())
|
self.locations.config.candidates.append(self.get_steam_location())
|
||||||
except (OSError, KeyError, UnresolvableLocationError):
|
except (OSError, KeyError, UnresolvableLocationError):
|
||||||
pass
|
logging.debug("Steam isn't installed")
|
||||||
|
except ValueError as error:
|
||||||
|
logging.debug("RetroArch Steam location candiate not found", exc_info=error)
|
||||||
|
|
||||||
def get_steam_location(self) -> str:
|
def get_steam_location(self) -> str:
|
||||||
|
"""
|
||||||
|
Get the RetroArch installed via Steam location
|
||||||
|
|
||||||
|
:raise UnresolvableLocationError: if steam isn't installed
|
||||||
|
:raise KeyError: if there is no libraryfolders.vdf subpath
|
||||||
|
:raise OSError: if libraryfolders.vdf can't be opened
|
||||||
|
:raise ValueError: if RetroArch isn't installed through Steam
|
||||||
|
"""
|
||||||
|
|
||||||
# Find steam location
|
# Find steam location
|
||||||
libraryfolders = SteamSource().locations.data["libraryfolders.vdf"]
|
libraryfolders = SteamSource().locations.data["libraryfolders.vdf"]
|
||||||
parse_apps = False
|
parse_apps = False
|
||||||
@@ -202,5 +212,5 @@ class RetroarchSource(Source):
|
|||||||
# Stop searching, as the library path directly above the appid has been found.
|
# Stop searching, as the library path directly above the appid has been found.
|
||||||
elif parse_apps and '"1118310"' in line:
|
elif parse_apps and '"1118310"' in line:
|
||||||
return Path(f"{library_path}/steamapps/common/RetroArch")
|
return Path(f"{library_path}/steamapps/common/RetroArch")
|
||||||
else:
|
# Not found
|
||||||
logging.debug("Steam RetroArch not installed.")
|
raise ValueError("RetroArch not found in Steam library")
|
||||||
|
|||||||
Reference in New Issue
Block a user