From 8f23726918fd8ded18ce9e55e6199df87abcc7cf Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 20 Jun 2019 10:52:36 +0200 Subject: Fix converted media being saved with original extension and mime type (#11130) --- app/models/media_attachment.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/models/media_attachment.rb') diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 5ca218411..ae94ce68a 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -70,12 +70,14 @@ class MediaAttachment < ApplicationRecord AUDIO_STYLES = { original: { format: 'ogg', + content_type: 'audio/ogg', convert_options: {}, }, }.freeze VIDEO_FORMAT = { format: 'mp4', + content_type: 'video/mp4', convert_options: { output: { 'loglevel' => 'fatal', @@ -189,11 +191,11 @@ class MediaAttachment < ApplicationRecord if f.file_content_type == 'image/gif' [:gif_transcoder, :blurhash_transcoder] elsif VIDEO_MIME_TYPES.include?(f.file_content_type) - [:video_transcoder, :blurhash_transcoder] + [:video_transcoder, :blurhash_transcoder, :type_corrector] elsif AUDIO_MIME_TYPES.include?(f.file_content_type) - [:transcoder] + [:transcoder, :type_corrector] else - [:lazy_thumbnail, :blurhash_transcoder] + [:lazy_thumbnail, :blurhash_transcoder, :type_corrector] end end end -- cgit