Skip to content
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

Audio/flac? #42

Closed
jrochkind opened this issue Apr 13, 2021 · 4 comments · Fixed by #47
Closed

Audio/flac? #42

jrochkind opened this issue Apr 13, 2021 · 4 comments · Fixed by #47

Comments

@jrochkind
Copy link

Previous marcel analyzed a FLAC file and returned mime-type: audio/flac.

New 1.0 with it's own data decides audio/x-flac instead. Perhaps because of this line:

'flac' => 'audio/x-flac',

It is not clear to me which is "right", the situation with "official" mime/content-types has gotten a bit out of hand.

But a differnet part of marcel uses audio/flac:

"audio/flac", # .flac

Not sure if these data tables are generated from some upstream source, so this is an issue (if it is one?) for some such source? If the marcel/tables.rb is generated from an upstream source, a comment at top of file saying so might be helpful.

Is there any way for me to configure marcel to tell it I'd rather it return audio/flac?

@gmcgibbon
Copy link
Member

gmcgibbon commented May 11, 2021

#46 and #45 this is indeed also a regression. I'll take a look at it.

In the meantime, you should be able to extend marcel like these manual overrides: https://github.com/rails/marcel/blob/a525d5b38f287ca0511c8eb26e657a1d46686e5f/lib/marcel/mime_type/definitions.rb

@jrochkind
Copy link
Author

Thanks! As I tried to look into it more.... it's unclear that audio/flac actually is "legal", it's not in the IANA registry... but many tools use it anyway... while others use audio/x-flac. it's unclear to me what the "right" thing to do would be if you were starting from scratch... which might not be the same as the "right" thing in marcel which has a history of doing it one way.

@gmcgibbon
Copy link
Member

gmcgibbon commented May 12, 2021

I'm also not sure which one is more correct, but the fact that marcel < 1.0.0 used audio/flac makes me think it should be audio/flac. The difference is a side effect of switching to a different types DB that's appropriately licensed. Open to opinions on the PR though! 😄

@jrochkind
Copy link
Author

jrochkind commented May 12, 2021

Yeah, I actually can't decide what I think is best.

If marcel had already been 1.0, I think it would be legit to say it should stay the same in the interest of backwards compat. But marcel wasn't, so made zero promises as to backwards compat. But this itself was probably a mistake, marcel not being 1.0 long ago, as it was so widely used in production and a dependency of Rails... so we maybe should treat it as if it were 1.0, meaning backwards compat, yeah.

On the other hand, audio/flac may be literally officially illegal. On the other other hand, plenty of tools seem to use it anyway in the wild.

So who knows! Whatever is least disruptive to existing users of the tool is best I guess! And I'm not even sure what that is at this point!

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

Successfully merging a pull request may close this issue.

2 participants