Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Android 11: default directory results in no cached downloads #99

Open
Rudd-O opened this issue Nov 14, 2020 · 1 comment
Open

Android 11: default directory results in no cached downloads #99

Rudd-O opened this issue Nov 14, 2020 · 1 comment

Comments

@Rudd-O
Copy link

Rudd-O commented Nov 14, 2020

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
Copy link
Author

Rudd-O commented Nov 15, 2020

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.

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

No branches or pull requests

1 participant