caption_crunch
caption_crunch copied to clipboard
Add a `CaptionCrunch.detect` method
It'd be really handy to know early on in the process of adding a user-generated captioning track to a file if it's in a format that's already supported by the backend.
The proposed method would work something like:
track_io = get_user_input()
supported = case CaptionCrunch.detect(track_io)
when CaptionCrunch::Format::VTT, CaptionCrunch::Format::TTML
true
else
false
end
return 415 unless supported
do_some_stuff(track_io)
return 200
Oh, good stuff in #4 - failing early rules - but this seems like a higher-level issue.