about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-06-19 23:42:38 +0200
committermultiple creatures <dev@multiple-creature.party>2020-02-21 03:40:29 -0600
commit480a83e843b92cc1fa4378b576bfd173024f3f8c (patch)
treeb5cb7b592bdb9bffb0f95970cbef8b7a1ee8f12e /app/services
parentb956d469846e9530dd6fa020a1161cd1b9d2b7dd (diff)
port tootsuite#11123 to monsterfork: Add audio uploads
* Add audio uploads

Fix #4827

Accept uploads of OGG, WAV, FLAC, OPUS and MP3 files, and converts
them to OGG. Media attachments get a new `audio` type. In the UI,
audio uploads are displayed identically to video uploads.

* Improve code style
Diffstat (limited to 'app/services')
-rw-r--r--app/services/post_status_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 696a333f1..c9e81808d 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -275,7 +275,7 @@ class PostStatusService < BaseService
 
     @media = @account.media_attachments.where(status_id: nil).where(id: @options[:media_ids].take(6).map(&:to_i))
 
-    raise Mastodon::ValidationError, I18n.t('media_attachments.validations.images_and_video') if @media.size > 1 && @media.find(&:video?)
+    raise Mastodon::ValidationError, I18n.t('media_attachments.validations.images_and_video') if @media.size > 1 && @media.find(&:audio_or_video?)
   end
 
   def process_bangtags