diff options
author | Thibaut Girka <thib@sitedethib.com> | 2020-07-15 15:32:40 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-07-15 15:32:40 +0200 |
commit | 3f60b096b51b000905290d69ea05b874b60fa9e0 (patch) | |
tree | 0b8c7011810b4a97523c2c63816735e519f0682c /app/models/media_attachment.rb | |
parent | 7a23347db5be3f262dbcafbecf768588dc648bda (diff) | |
parent | d9cad44ca54374cafa0c97775083bb1bc0a5a3ce (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - `config/routes.rb`: Upstream disabled E2EE routes, which we did earlier, but slightly differently. Took upstream's version.
Diffstat (limited to 'app/models/media_attachment.rb')
-rw-r--r-- | app/models/media_attachment.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index cc0a1ab27..0441fc699 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -165,6 +165,9 @@ class MediaAttachment < ApplicationRecord processors: ->(f) { file_processors f }, convert_options: GLOBAL_CONVERT_OPTIONS + before_file_post_process :set_type_and_extension + before_file_post_process :check_video_dimensions + validates_attachment_content_type :file, content_type: IMAGE_MIME_TYPES + VIDEO_MIME_TYPES + AUDIO_MIME_TYPES validates_attachment_size :file, less_than: IMAGE_LIMIT, unless: :larger_media_format? validates_attachment_size :file, less_than: VIDEO_LIMIT, if: :larger_media_format? @@ -257,9 +260,6 @@ class MediaAttachment < ApplicationRecord after_post_process :set_meta - before_file_post_process :set_type_and_extension - before_file_post_process :check_video_dimensions - class << self def supported_mime_types IMAGE_MIME_TYPES + VIDEO_MIME_TYPES + AUDIO_MIME_TYPES |