fix(steam-compat): repair stale mappings and apply explicit requests on tools with a Linux build

This commit is contained in:
maxjivi05 committed 2026-12-01 13:44:54 -05:00
1 parent 2d13d0770a
commit 0157a727bb
2 files changed
+26 -3

No files matched your search

@@ -1233,10 +1233,15 @@ def plan_mapping(current, installed, runnable, default, auto, native=None, picks
for app in sorted((set(current) | installed | picks | set(auto) | set(overrides) | native_choices | set(tools)) - {"0"}, key=app_order):
name = current.get(app, "")
if app in tools and "linux" in tools[app]:
if "windows" in tools[app]:
if name and name == auto.get(app):
if "windows" not in tools[app]:
if name and (name.lower() in runnable or "proton" in name.lower()):
changes[app] = None
elif name and (name.lower() in runnable or "proton" in name.lower()):
continue
if app in overrides:
target = overrides[app]
if target is not DEFERRED_GAME_TOOL and (target or None) != (name or None):
changes[app] = target or None
elif name and (name == auto.get(app) or unrunnable(name, runnable) or name.lower() in removed):
changes[app] = None
continue
if app in overrides:
+18
View File
@@ -105,6 +105,24 @@ class ToolPlatformsTest(unittest.TestCase):
changes, auto = self.plan({"0": TOOL, "900007": name}, {"976730": TOOL})
self.assertNotIn("900007", changes)
def test_stale_tool_on_a_tool_with_a_linux_build_is_cleared(self):
self.add_launch_only_linux_tool()
for name, removed in (("GE-Proton11-7", ("GE-Proton11-7",)), ("proton_9", ())):
with self.subTest(name=name):
changes, auto = self.plan({"0": TOOL, "900007": name}, removed=removed)
self.assertIsNone(changes["900007"])
self.assertNotIn("900007", auto)
def test_explicit_request_on_a_tool_with_a_linux_build_is_applied(self):
self.add_launch_only_linux_tool()
changes, auto = self.plan({"0": TOOL}, overrides={"900007": TOOL})
self.assertEqual(changes["900007"], TOOL)
changes, auto = self.plan({"0": TOOL, "900007": TOOL}, overrides={"900007": None})
self.assertIsNone(changes["900007"])
changes, auto = self.plan({"0": TOOL, "900007": TOOL}, overrides={"900007": TOOL})
self.assertNotIn("900007", changes)
self.assertNotIn("900007", auto)
def test_removed_ge_proton_is_cleared_with_or_without_saved_ownership(self):
for saved in ({}, {"1826330": "GE-Proton11-7"}):
with self.subTest(saved=saved):