Fix support for MP4 files that are actually M4V files (#11210)
Resolve #11187
This commit is contained in:
		
							parent
							
								
									ff65c494a6
								
							
						
					
					
						commit
						6385ddb97f
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -60,7 +60,9 @@ module Attachmentable
 | 
			
		|||
  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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue