闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
442 B

  1. # frozen_string_literal: true
  2. module Paperclip
  3. # This transcoder is only to be used for the MediaAttachment model
  4. # to check when uploaded videos are actually gifv's
  5. class VideoTranscoder < Paperclip::Processor
  6. def make
  7. meta = ::Av.cli.identify(@file.path)
  8. attachment.instance.type = MediaAttachment.types[:gifv] unless meta[:audio_encode]
  9. Paperclip::Transcoder.make(file, options, attachment)
  10. end
  11. end
  12. end