fix(xbox): mount external storage for downloads

This commit is contained in:
XxJSONDeruloxX authored and Kurt Himebauch committed 2026-10-23 23:56:24 -04:00
1 parent fcfbb74068
commit 2c8ae3753c
5 files changed
+48 -6

No files matched your search

@@ -38,6 +38,29 @@ class StoreInstallRootTest {
assertEquals(1, StoreInstallRoot.targets(app).size)
}
@Test fun externalStoreInstallPathsMapIntoTheirGuestMountWithoutPrefixCollisions() {
val cardRoot = File(app.filesDir, "card/Games").apply { mkdirs() }
val guestRoot = "/mnt/droiddeck-stores/card"
val roots = listOf(cardRoot to guestRoot)
assertEquals("$guestRoot/Stores/Xbox/Doom", StoreInstallRoot.externalGuestPath(
File(cardRoot, "Stores/Xbox/Doom"), roots))
assertEquals(null, StoreInstallRoot.externalGuestPath(
File(cardRoot.parentFile, "Games-old/Stores/Xbox/Doom"), roots))
}
@Test fun externalStoreBindsCreateGuestTargetsAndSkipUnavailableVolumes() {
val host = File(app.filesDir, "card/Games").apply { mkdirs() }
val guestRoot = "/mnt/droiddeck-stores/card"
val guestFs = File(app.filesDir, "linuxfs").apply { mkdirs() }
val missing = File(app.filesDir, "missing/Games")
assertEquals(listOf("${host.path}:$guestRoot"), StoreInstallRoot.externalBindSpecs(
listOf(host to guestRoot, missing to "/mnt/droiddeck-stores/missing"), guestFs))
assertTrue(File(guestFs, "mnt/droiddeck-stores/card").isDirectory)
assertFalse(File(guestFs, "mnt/droiddeck-stores/missing").exists())
}
@Test fun anExistingInstallWinsOverAFreshFolderUnderTheChosenRoot() {
SessionPrefs.setGameStorage(app, SessionPrefs.GAME_STORAGE_OFF, "")
val existing = File(StoreInstallRoot.storeDir(StoreInstallRoot.internalRoot(app), Store.GOG), "Old Name").apply { mkdirs() }