Skip to content
Permalink
Browse files

Fix support for MP4 files that are actually M4V files (#11210)

Resolve #11187
  • Loading branch information...
Gargron committed Jun 30, 2019
1 parent f895bf1 commit 06424786a140e03fcb899232c3c418b7eaf26d5e
Showing with 3 additions and 1 deletion.
  1. +3 −1 app/models/concerns/attachmentable.rb
@@ -60,7 +60,9 @@ def appropriate_extension(attachment)
end

def calculated_content_type(attachment)
Paperclip.run('file', '-b --mime :file', file: attachment.queued_for_write[:original].path).split(/[:;\s]+/).first.chomp
content_type = Paperclip.run('file', '-b --mime :file', file: attachment.queued_for_write[:original].path).split(/[:;\s]+/).first.chomp
content_type = 'video/mp4' if content_type == 'video/x-m4v'
content_type
rescue Terrapin::CommandLineError
''
end

0 comments on commit 0642478

Please sign in to comment.
You can’t perform that action at this time.