Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default directory of scummvm libretro in android is or can become a unreachable forbidden one #64

Open
i30817 opened this issue Sep 28, 2024 · 6 comments

Comments

@i30817
Copy link

i30817 commented Sep 28, 2024

When you try to add or mass add games (a requirement to create the playlists correctly), in android you're faced with a browser with a single / dash, and no visible files to navigate. As you can't navigate most users will be stuck unless they know they can navigate to a user visible folder all at once using the onscreen keyboard function (usually /storage/emulated/0/ ).

The code seems to assume that the root is a fallback to navigate the filesystem. But the root isn't readable in android, either that or the core remembers the last used dir and it allowed me to navigate up to a unnavigable dir.

Anyway, please make the default dir here something readable in the place android reserves for the user. Forbidding the user from getting stuck in a technically existing, but actually unnavigable dir would also be nice (I don't know if the core remembers like scummvm but that is a danger if the user keeps pressing up and then restarts the core once they realize they can't navigate and the core puts the browser again in a unnavigable dir).

It would also be nice if the default screen also had the code that upstream scummvm has in the root (as a line (paraphrasing, don't remember) in the directory entries with <> enclosing it <add remote directory>) to open the Files app because the files app can use a SAF plugin (like RSAF) to add a remote directory and scan nfs or webdav (for instance).

@i30817 i30817 changed the title default directory of scummvm libretro in android is a unreachable forbidden one default directory of scummvm libretro in android is or can become a unreachable forbidden one Sep 28, 2024
@spleen1981
Copy link
Collaborator

Can you check what happens if you:

  • set 'last browsed path' to default from scummvm gui (press the 'c' button on the right)
  • close the core without trying to navigate any other folder
  • re-open the core.
    What is the new 'last browser path'?

@i30817
Copy link
Author

i30817 commented Oct 23, 2024

/storage/emulated/0/Retroarch/system (well it appears as <default> after pressing c without reloading and if you try to add a game without reloading the core right away it selects / as its default for some bug - restarting right away instead of trying to add games fixes that).

@spleen1981
Copy link
Collaborator

Ok, this part has been a little bit reworked, now if last browsed path points to a not existing or not readable folder, it will default after applying the settings to retroarch system path, no need to reload the core.
All paths are tested at core startup, and removed if not existing or not readable.

You can test current master (f6ff9f3)

@i30817
Copy link
Author

i30817 commented Oct 27, 2024

Seems like it worked (I didn't build, just updated the core in the RA android menu).

@i30817
Copy link
Author

i30817 commented Oct 27, 2024

However you can still get trapped in the file browser browser until you restart (assuming you don't know about the reset button for the last directory in the global options). Scummvm will change the default dir if you try to add a game in a unreadable dir, and you won't be able to navigate out because even cancelling or failing adding a game that way doesn't prevent the last directory being used in the file browser widget if you open it again without restarting (restarting puts it in the RA system dir again because it's nonexisting\nonreadable, the code you added I'm assuming).

Really what's needed is the go up button in upstream to be grayed out in the file browser widget if you can't read the parent directory, and the direct entry field to revert to the previous valid dir if entering the path directly fails with a non-existing or non readable dir too.

The widget seems to assume that every filesystem will follow Linux distros rules where if you're on a directory, you also have always at least read only access to the parent, which is not the case for android.

@spleen1981
Copy link
Collaborator

Good point, you can test latest master @ d7276b9.
Besides the tests described above, browser now will not go to the parent path if not readable, and will not accept a not existing or not readable path, even if typed in by hand. In this case it will take the last valid path selected (e.g. the last valid folder selected while browsing, no way to change this behaviour core-side).
Now it should be not possible to get stuck in a dead end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants