mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 14:26:00 +00:00
fix(steam-x64): new store shortcuts get a compatibility tool (#2336)
fix: map new Steam shortcuts to x64 Proton
This commit is contained in:
1 parent
8ee50e5b38
commit
f4503c2eda
2 files changed
+26
-1
No files matched your search
@@ -1540,7 +1540,7 @@ def register_default(config_path, apps=(), protect=(), default=None, catalog=Non
|
||||
auto = followers(state, current)
|
||||
known = {app for app in state.get("owned", ()) if isinstance(app, str)} if isinstance(state.get("owned"), list) else set()
|
||||
pinned = {app: current[app] for app in set(owned) - known
|
||||
if current.get(app) in {TOOL, previous} | gone and app not in auto}
|
||||
if app in current and current.get(app) in {TOOL, previous} | gone and app not in auto}
|
||||
if pinned and isinstance(auto, dict):
|
||||
state["auto"] = dict(auto, **pinned)
|
||||
state["owned"] = sorted(set(owned), key=app_order)
|
||||
|
||||
@@ -99,6 +99,31 @@ class X64RepointTest(unittest.TestCase):
|
||||
self.assertEqual(COMPAT["x64_repoint"](str(self.root), None), [])
|
||||
self.assertEqual((self.root / "config" / "config.vdf").read_text(), before)
|
||||
|
||||
def test_new_owned_shortcut_gets_the_x64_default_and_explicit_choice_stays(self):
|
||||
app = "2350879490"
|
||||
chosen = "proton-cachyos-a64"
|
||||
config = self.root / "config" / "config.vdf"
|
||||
state = self.root / "droiddeck-compat"
|
||||
self.assertEqual(COMPAT["register_default"](
|
||||
str(config), apps=[app], protect={chosen: "proton-cachyos-a64"},
|
||||
default="GE-Proton11-7-a64", directory=str(state),
|
||||
linux_tool="droiddeck-direct", owned=[app]), "GE-Proton11-7-a64")
|
||||
self.assertEqual(self.mapping()[app], "GE-Proton11-7-a64")
|
||||
self.assertEqual(COMPAT["register_default"](
|
||||
str(config), apps=[app], protect={chosen: "proton-cachyos-a64"},
|
||||
default="GE-Proton11-7-a64", directory=str(state),
|
||||
linux_tool="droiddeck-direct", owned=[app]), "GE-Proton11-7-a64")
|
||||
self.assertEqual(self.mapping()[app], "GE-Proton11-7-a64")
|
||||
tokens = COMPAT["tokenize"](config.read_text())
|
||||
mapping = COMPAT["mapping_block"](tokens)
|
||||
COMPAT["set_mapping"](tokens, mapping, app, chosen)
|
||||
config.write_text(COMPAT["serialize"](tokens))
|
||||
COMPAT["register_default"](
|
||||
str(config), apps=[app], protect={chosen: "proton-cachyos-a64"},
|
||||
default="GE-Proton11-7-a64", directory=str(state),
|
||||
linux_tool="droiddeck-direct", owned=[app])
|
||||
self.assertEqual(self.mapping()[app], chosen)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user