mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
fix(xbox): mount external storage for downloads
This commit is contained in:
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() }
|
||||
|
||||
Reference in new issue
Block a user