wa2c / cifs-documents-provider

CIFS Documents Provider
MIT License
269 stars 23 forks source link

findDocumentPath not supported #66

Closed RebelliousX closed 7 months ago

RebelliousX commented 8 months ago

EDIT : After more research, this might be related to DocumentsContract.EXTRA_INITIAL_URI .. If so, I don't think it can be fixed since it would be related to #19 .. if this is the case, please feel free to close this issue.

Issue I tried to use Flycast emulator for dreamcast, but I got an interesting error message regarding storage access. It says findDocumentPath not supported. I checked Android Developer site, it seems is a function receives a ContentResolver and Uri and returns a DocumentContract.Path (string?).

What is weird, the emulator is able to read the game files and enumerate them, but fails when I try to open any of them.

This is not a major issue really, I am happy with Redream emulator which works like a dream emulating dreamcast. But I thought that this error message was interesting and fixing this, it might fix other issues too.

To Reproduce Steps to reproduce the behavior for the missing findDocumentPath():

  1. Open Flycast dreamcast emulator
  2. for first time use, cancel current directory (used for saves and emulator's data).
  3. Go to settings, add game disc images directory.
  4. Tap done at the top.
  5. tap on the game, for example, Shenmue.
  6. When it starts, it gives error message: Storage Access Failed.. findDocumentPath not supported.

findDocumentPath

wa2c commented 7 months ago

@RebelliousX I implemented findDocumentPath function. https://github.com/wa2c/cifs-documents-provider/commit/5b3fc7bf9e27b41484a29f42c0ac9306c54724dd

I implemented this using standard local storage values ​​as reference. I don't have any emulator games. Therefore, it is not possible to check whether it is valid or not. Please check it.

RebelliousX commented 7 months ago

@wa2c Thanks, this fixed the problem, I am able to load the games fine too.

I am guessing that this fix in https://github.com/wa2c/cifs-documents-provider/commit/5b3fc7bf9e27b41484a29f42c0ac9306c54724dd fixed another issue too. Issue #50 regarding the Smart Audio Book Reader seems to be fixed ( I have to test more and revert to previous commit and see if issue persists ). Now, I am able to set the directory successfully. I can't test it though since I don't have audio books.

Please feel free to close this issue too.

RebelliousX commented 7 months ago

@wa2c so the issue with the Audio Book is partially fixed, I can load mp3 audio chapters if I specify the directory of the MP3s themselves (not nested in other folders).

According to the program itself, it wants AudioBooks/Auther Name/Book Title/*.mp3. It doesn't seem it is able to scan directories recursively with Cifs Document Provider, something is missing, probably a function or something.

I tried free book Art of War by Sun Tzu.

RebelliousX commented 7 months ago

I reverted the changes prior to the fix just to test, It doesn't seem it affected Smart Audio Book Reader. Probably the app itself has changed since last time we checked it.