diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-06-20 10:52:36 +0200 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-21 03:42:05 -0600 |
commit | 2dacf79bcc58094b58f1689189ce130fb34b2c8f (patch) | |
tree | f39a9740405d1738ae06d319699c9910bf1b37ac /app/models/media_attachment.rb | |
parent | 480a83e843b92cc1fa4378b576bfd173024f3f8c (diff) |
port tootsuite#11130 to monsterfork: Fix converted media being saved with original extension and mime type
Diffstat (limited to 'app/models/media_attachment.rb')
-rw-r--r-- | app/models/media_attachment.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 3ef163f46..ce3549539 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -87,12 +87,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', @@ -228,11 +230,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 |