mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
fix: add a picked exe the session cannot see by binding its folder (#1173)
Adding a game from a single exe outside internal storage and the game library, such as a microSD card, only showed "This location is not available in the session" and added nothing. #1153 made "Add all games in this folder" bind such a folder under /root/Games, but a picked exe still had no guest path. addExe now binds the folder the same way when the session cannot see the exe (the game it belongs to, or else the exe's own folder), then adds the game. The bind is mounted from the next session start. A folder the session already sees is not bound again, and a folder the app cannot read is still refused.
This commit is contained in:
1 parent
bc3715aad6
commit
a5c587bd71
2 files changed
+44
-4
No files matched your search
@@ -248,7 +248,10 @@ object AddedGames {
|
||||
if (owner != null && owner.path !in SessionPrefs.removedAddedGames(app)) {
|
||||
single(app, owner.path)?.takeIf { canonical(it.exe) == path }?.let { return AddResult.Existing(it) }
|
||||
}
|
||||
if (owner == null && guestPath(app, exe) == null) return AddResult.Unreachable
|
||||
if (guestPath(app, exe) == null) {
|
||||
(owner ?: exe.parentFile)?.takeIf { guestPath(app, it) == null }?.let { bindFolder(app, it) }
|
||||
if (guestPath(app, exe) == null) return AddResult.Unreachable
|
||||
}
|
||||
val folder = owner ?: exe.parentFile ?: return AddResult.NotFound
|
||||
SessionPrefs.setAddedGameRemoved(app, folder.path, false)
|
||||
SessionPrefs.setAddedGameExe(app, folder.path, exe.path)
|
||||
|
||||
Reference in new issue
Block a user