-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Downloading/manipulating M4B file adds a .MP3 file extension #94
Comments
What's the mime type you're using when saving the M4B files? Are you using
|
The server was using node-express I found out that M4B was not listed in the mime type db they use (https://github.com/jshttp/mime-db/blob/master/db.json) I updated the server to use our internal set of mime types that uses I'm not positive but I think
https://www.tunefab.com/tutorials/m4a-vs-m4b.html Will SimpleStorage handle M4B correctly with |
SimpleStorage relies on OS level val fileExtension = MimeTypeMap.getSingleton().getExtensionFromMimeType("application/octet-stream") I will make a feature that can handle file extensions globally, regardless of the API levels by using the mime type DB you suggested. Thanks for the idea! I'll let this issue open until the feature is merged. BTW, you had better to use SimpleStorage v1.4.1, because it contains many bugfixes. Since current Android OS does not handle M4B yet, then just use mime type |
Is there a way I can set this from the android app without having to serve the file with mime type The server is serving files to many different clients and not just the android app so I would like to keep the mime type The mime type DB I shared is just what node-express uses, but it is missing the mime type for the file extension I actually need so if you do use it I hope you would add M4B in there. Update: I'm not sure I understand correctly. If the server uses |
No. It is the limitation from the OS itself. Nothing we can do. Using val fileExtension = MimeTypeMap.getSingleton().getExtensionFromMimeType("audio/mp4") ?: "*/*"
Sure. I just need to find more reliable online mime type database out there. Please tell me if you know something better.
Use val mimeTypeFromServer = ...
val fileExtension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeTypeFromServer) ?: "*/*" |
I'm not sure what you mean by this. How do I use a different mime type after the file has been downloaded? I don't think this explains why SimpleStorage was appending a file extension even though the file already had a file extension. That is the reason I'm asking if I use |
I think I know what you mean. It is caused by extension function What is the previous file location before you moving the files? Maybe in |
The user selects a folder on their device where they want the audio files to go. Downloading directly to their selected folder was crashing on certain devices (something with permissions) so I set it up to first download everything to the downloads folder:
then after all the audio files are downloaded they are moved into the folder the user selected. So to answer your question the files are downloaded to DIRECTORY_DOWNLOADS |
Library version: 1.0.0+
OS version: Android 11 & 12
Device model: OnePlus6 & Pixel 6
Describe the bug
In debugging this issue advplyr/audiobookshelf-app#292 I found that starting at release v1.0.0 downloading .M4B audiobooks will add a .MP3 extension at the end.
I am able to resolve this issue by using v0.14.0
To Reproduce
Download or move a .m4b file on v1.0.0 or above
The text was updated successfully, but these errors were encountered: