Fix larger video files not being transcoded (#14306)
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.
Kirishima21/mastodon,pinfort/mastodon,pinfort/mastodon,im-in-space/mastodon,lynlynlynx/mastodon,masto-donte-com-br/mastodon,theoria24/mastodon,Kirishima21/mastodon,tri-star/mastodon,lindwurm/mastodon,abcang/mastodon,Kirishima21/mastodon,lynlynlynx/mastodon,yukimochi/mastodon,cobodo/mastodon,im-in-space/mastodon,tootsuite/mastodon,imas/mastodon,ykzts/mastodon,yukimochi/mastodon,masto-donte-com-br/mastodon,Ryanaka/mastodon,tri-star/mastodon,tootcafe/mastodon,Nyoho/mastodon,danhunsaker/mastodon,gol-cha/mastodon,musashino205/mastodon,lynlynlynx/mastodon,tootcafe/mastodon,danhunsaker/mastodon,tootsuite/mastodon,danhunsaker/mastodon,Nyoho/mastodon,koba-lab/mastodon,maa123/mastodon,yi0713/mastodon,maa123/mastodon,gol-cha/mastodon,Ryanaka/mastodon,yi0713/mastodon,im-in-space/mastodon,h3zjp/mastodon,theoria24/mastodon,maa123/mastodon,im-in-space/mastodon,yi0713/mastodon,Ryanaka/mastodon,tri-star/mastodon,Nyoho/mastodon,ikuradon/mastodon,musashino205/mastodon,ikuradon/mastodon,maa123/mastodon,Kirishima21/mastodon,h3zjp/mastodon,tootcafe/mastodon,tootsuite/mastodon,imas/mastodon,danhunsaker/mastodon,yukimochi/mastodon,gol-cha/mastodon,masto-donte-com-br/mastodon,MitarashiDango/mastodon,musashino205/mastodon,lynlynlynx/mastodon,h3zjp/mastodon,cobodo/mastodon,cobodo/mastodon,abcang/mastodon,glitch-soc/mastodon,glitch-soc/mastodon,koba-lab/mastodon,MitarashiDango/mastodon,koba-lab/mastodon,masto-donte-com-br/mastodon,primenumber/mastodon,glitch-soc/mastodon,pinfort/mastodon,theoria24/mastodon,lindwurm/mastodon,primenumber/mastodon,glitch-soc/mastodon,gol-cha/mastodon,imas/mastodon,ykzts/mastodon,primenumber/mastodon,MitarashiDango/mastodon,theoria24/mastodon,Nyoho/mastodon,abcang/mastodon,tootsuite/mastodon,imas/mastodon,h3zjp/mastodon,primenumber/mastodon,ykzts/mastodon,pinfort/mastodon,koba-lab/mastodon,tri-star/mastodon,abcang/mastodon,yukimochi/mastodon,yi0713/mastodon,ykzts/mastodon,MitarashiDango/mastodon,Ryanaka/mastodon,lindwurm/mastodon,cobodo/mastodon,tootcafe/mastodon,ikuradon/mastodon,ikuradon/mastodon,lindwurm/mastodon,musashino205/mastodon