about summary refs log tree commit diff
path: root/app/serializers
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/serializers
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/serializers')
-rw-r--r--app/serializers/initial_state_serializer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb
index 5501ea040..996ca0102 100644
--- a/app/serializers/initial_state_serializer.rb
+++ b/app/serializers/initial_state_serializer.rb
@@ -84,7 +84,7 @@ class InitialStateSerializer < ActiveModel::Serializer
   end
 
   def media_attachments
-    { accept_content_types: [] }
+    { accept_content_types: MediaAttachment::IMAGE_FILE_EXTENSIONS + MediaAttachment::VIDEO_FILE_EXTENSIONS + MediaAttachment::AUDIO_FILE_EXTENSIONS + MediaAttachment::IMAGE_MIME_TYPES + MediaAttachment::VIDEO_MIME_TYPES + MediaAttachment::AUDIO_MIME_TYPES }
   end
 
   private