From cf557f18497e98aea0dbf8a799186aa92dc34663 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Thu, 27 Dec 2018 20:19:26 -0600 Subject: Plain AAC audio uploads live again. -DT --- lib/paperclip/audio_transcoder.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/paperclip/audio_transcoder.rb b/lib/paperclip/audio_transcoder.rb index 323ec7bfe..3d79e8397 100644 --- a/lib/paperclip/audio_transcoder.rb +++ b/lib/paperclip/audio_transcoder.rb @@ -7,16 +7,12 @@ module Paperclip meta = ::Av.cli.identify(@file.path) # {:length=>"0:00:02.14", :duration=>2.14, :audio_encode=>"mp3", :audio_bitrate=>"44100 Hz", :audio_channels=>"mono"} - if meta[:duration] > max_aud_len - raise Mastodon::ValidationError, "Audio uploads must be less than #{max_aud_len} seconds in length." - end - - final_file = Paperclip::Transcoder.make(file, options, attachment) - - attachment.instance.file_file_name = 'media.mp4' - attachment.instance.file_content_type = 'video/mp4' + + attachment.instance.file_file_name = 'media.m4a' + attachment.instance.file_content_type = 'audio/mp4' attachment.instance.type = MediaAttachment.types[:video] + final_file = Paperclip::Transcoder.make(file, options, attachment) final_file end end -- cgit