-
Notifications
You must be signed in to change notification settings - Fork 491
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
detected mime type of m4a uploaded in zip #10923
base: develop
Are you sure you want to change the base?
Conversation
Huh, the API tests passed but afterward there was an Ansible error at https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-10923/1/console Ansible errorBranch 10922-content-type-of-m4a-in-zip from https://github.com/DANS-KNAW-jp/dataverse has been deployed to http://ec2-3-95-195-223.compute-1.amazonaws.com/ GitHub has been notified of this commit’s build result Finished: FAILURE It seems unrelated to this PR. Thanks for the PR, @jo-pol |
@jo-pol - given https://mimetype.io/audio/x-m4a - should this use audio/mp4 instead? I'm not certain, but I think using audio/mp4 would make files uploaded as audio/x-m4a end up with the audio/mp4 type. (changing existing files would require running the redetect API). I see we have both in the MimeTypeDisplay file: dataverse/src/main/java/propertyFiles/MimeTypeDisplay.properties Lines 204 to 205 in 9339e44
Also note that the jenkins build problem here is the same as on #10899 - somehow the version of count.pl being picked up by ansible is different that the one in the IQSS/develop branch:
|
Re - the build failure - it looks like this is from a bug in dataverse-ansible and doesn't have anything to do with your branches. We're working on a fix but won't hold up the PR for that once we resolve the audio/mp4 x-m4a issue. |
Re (x-)m4a Having said that and beyond the scope of the issue: shouldn't we overrule the browser provided mime type in FileUtil.useRecognizedType for deprecated types? A second aside: it looks to me that CreateNewDataFilesCommand does a pretty inefficient job scanning a file multiple times to recognize the type and throwing that result away to use the supplied type. |
How about adding both with a comment that the x- version is obsolete but still used in 2024? That would support all browser now (assuming people register the player for both types). Re: shouldn't we overrule the browser provided mime type in FileUtil.useRecognizedType for deprecated types? - probably, the note on useRecognizedType indicates this was thought about (in general, not specific to obsolete types) and just not implemented so far. Re: it looks to me that CreateNewDataFilesCommand does a pretty inefficient job scanning a file multiple times to recognize the type and throwing that result away to use the supplied type. - It's hard to tell, but I think any given file is only scanned once, but there are different paths through that command, so there are different places where we recognize normally uploaded files, direct uploaded files, files in zips, shapefile components, etc. It does look like we want to always try recognizing once, since we could discover the real type is one of the ingestible ones even though the browser says otherwise. |
What this PR does / why we need it:
store the proper mime type (and show the previewer) for m4a files uploaded in a zip
Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this:
See issue
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
files with extension m4a uploaded in a zip will get content-type audio/x-m4a rather than application/octet-stream
Additional documentation: