Audinaut icon indicating copy to clipboard operation
Audinaut copied to clipboard

Android 11: default directory results in no cached downloads

Open Rudd-O opened this issue 3 years ago • 1 comments

Hello. If the default directory is used, when I instruct Audinaut to cache a song, it won't do it. It also won't work in /storage/emulated/0/Music because the app attempts to create a temporary file which is actually application/octet-stream and that results in an IllegalArgumentException.

I had to change .../media/ to .../data/ in the path for it to work. Unfortunately that prevents other music apps from seeing and playing the music downloaded by Audinaut

It's likely your app will have to request file management permission for it to work correctly with any folder outside the app's data folder.

Rudd-O avatar Nov 14 '20 03:11 Rudd-O

Just to be clear — that test with the temporary file is probably easy to fix: just have the test actually write a proper MP3 (even if one second long) as the temporary file, with the proper .mp3 extension. That ought to work. The reason it will work is because the Android OS is actually detecting the content type of the file being written, and barfing an error back to the app if the file written isn't a media file, given that the target directory is exclusively for media files.

Rudd-O avatar Nov 15 '20 18:11 Rudd-O