fix: follow moved retrodeck folders under --dest

A run given --platform and --dest never detects, so retrodeck.json was
never read and a moved bios/ folder was ignored. MovedFolders looks the
root up on first use, is reset per run, and detection only warms it.
This commit is contained in:
Abdessamad Derraz committed 2026-11-22 00:58:06 +01:00
1 parent 9f3fc2e0c1
commit c4a129e200
10 files changed
+177 -54

No files matched your search

+18 -1
View File
@@ -3549,7 +3549,7 @@ class RetroDeckFoldersMovedOneByOne(unittest.TestCase):
(conf / "retrodeck.json").write_text(json.dumps({"paths": paths}))
with unittest.mock.patch.object(install.Path, "home", return_value=home), \
unittest.mock.patch.object(install, "_detect_embedded", return_value=[]), \
unittest.mock.patch.dict(install._MOVED_FOLDERS, clear=True), \
unittest.mock.patch.object(install.MOVED, "_by_root", {}), \
contextlib.redirect_stderr(io.StringIO()):
found = install.detect_platforms("linux")
dests = {name: install._destination_path(home / "retrodeck", f"{name}/a.bin")
@@ -3579,6 +3579,23 @@ class RetroDeckFoldersMovedOneByOne(unittest.TestCase):
self.assertIn(("retrodeck", rd_home), found)
self.assertNotIn("bios/ at", label)
def test_a_run_that_never_detects_follows_the_move(self):
"""--platform retrodeck --dest D never detects, and the full-screen
interface passes --dest to every child run: the files went to
<home>/bios before a detection had filled the moved folders."""
home = scratch_dir(self)
sd = home / "sd"
conf = home / ".var/app/net.retrodeck.retrodeck/config/retrodeck"
conf.mkdir(parents=True)
(conf / "retrodeck.json").write_text(json.dumps({"paths": {
"rd_home_path": "", "bios_path": str(sd / "bios")}}))
with unittest.mock.patch.object(install.Path, "home", return_value=home), \
unittest.mock.patch.object(install.MOVED, "_by_root", {}):
dest = install._destination_path(home / "retrodeck", "bios/a.bin")
other = install._destination_path(home / "elsewhere", "bios/a.bin")
self.assertEqual(dest, (sd / "bios").resolve() / "a.bin")
self.assertEqual(other, (home / "elsewhere").resolve() / "bios" / "a.bin")
class AndroidCitationsNameTheRelease(unittest.TestCase):
"""The Android detection cited platform_unix.c lines of a RetroArch