]> cat aescling's git repositories - mastodon.git/commit
Fix larger video files not being transcoded (#14306)
authorThibG <thib@sitedethib.com>
Tue, 14 Jul 2020 16:50:19 +0000 (18:50 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Jul 2020 16:50:19 +0000 (18:50 +0200)
commita8e84a18f1d84943e8332ff8deba9d91b1cb3efd
treefc4e77319aea4bd3e7ce96799618f189f9c16775
parent4abe3be321a620641b9a316b168ce754d7438eff
Fix larger video files not being transcoded (#14306)

Since #14145, the `set_type_and_extension` has been moved from
`before_post_process` to `before_file_post_process`, but while the former
runs before all validations performed by Paperclip, the latter is dependent
on the order validations and hooks are defined.

In our case, this meant video files could be checked against the generic 10MB
limit, causing validation failures, which, internally, make Paperclip skip
post-processing, and thus, transcoding of the video file.

The actual validation would then happen after the type is correctly set, so
the large file would pass validation, but without being transcoded first.

This commit moves the hook definition so that it is run before checking for
the file size.
app/models/media_attachment.rb