From d156482b7919658817aeff261dfff160c8b25fa1 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Fri, 21 Feb 2020 05:55:18 -0600 Subject: patch media model from glitch-soc --- app/models/media_attachment.rb | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'app/models') diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 361646f7d..0f0594e5d 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -44,7 +44,7 @@ class MediaAttachment < ApplicationRecord IMAGE_STYLES = { original: { - pixels: 16777216, # 4096x4096px + pixels: 16_777_216, # 4096x4096px file_geometry_parser: FastGeometryParser, }, @@ -55,23 +55,6 @@ class MediaAttachment < ApplicationRecord }, }.freeze - AUDIO_STYLES = { - original: { - format: 'mp4', - convert_options: { - output: { - filter_complex: '"[0:a]showwavespic=s=640x360:colors=lime|green,format=yuv420p[v]"', - map: '"[v]" -map 0:a', - threads: 2, - vcodec: 'libx264', - acodec: 'aac', - 'b:a': '256k', - movflags: '+faststart', - }, - }, - }, - }.freeze - VIDEO_STYLES = { small: { convert_options: { @@ -174,7 +157,7 @@ class MediaAttachment < ApplicationRecord end def needs_redownload? - (file.blank? || (Paperclip::Attachment.default_options[:storage] == :filesystem && !File.exist?(file.path))) && remote_url.present? + file.blank? && remote_url.present? end def larger_media_format? -- cgit