diff options
Diffstat (limited to 'app/serializers/rest/media_attachment_serializer.rb')
-rw-r--r-- | app/serializers/rest/media_attachment_serializer.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/serializers/rest/media_attachment_serializer.rb b/app/serializers/rest/media_attachment_serializer.rb index f6e7c79d1..51011788b 100644 --- a/app/serializers/rest/media_attachment_serializer.rb +++ b/app/serializers/rest/media_attachment_serializer.rb @@ -4,7 +4,8 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer include RoutingHelper attributes :id, :type, :url, :preview_url, - :remote_url, :text_url, :meta + :remote_url, :text_url, :meta, + :description def id object.id.to_s @@ -18,6 +19,10 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer end end + def remote_url + object.remote_url.presence + end + def preview_url if object.needs_redownload? media_proxy_url(object.id, :small) |