diff options
author | Takeshi Umeda <noel.yoshiba@gmail.com> | 2020-07-20 02:53:31 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-19 19:53:31 +0200 |
commit | 47931db1f50db3b6773fbb3cc4645fdb4a4692eb (patch) | |
tree | f48921d7dd0113ae3eed8e807517f2a1954e00de /app/serializers/rest | |
parent | 2ada2ae18af3429f9666fd35c70675dc62a0b99f (diff) |
Add thumbnail_remote_url in MediaAttachment REST response (#14358)
* Add thumbnail_remote_url in MediaAttachment REST response * Change thumbnail_remote_url to preview_remote_url
Diffstat (limited to 'app/serializers/rest')
-rw-r--r-- | app/serializers/rest/media_attachment_serializer.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/serializers/rest/media_attachment_serializer.rb b/app/serializers/rest/media_attachment_serializer.rb index e65f7acf1..a24f95315 100644 --- a/app/serializers/rest/media_attachment_serializer.rb +++ b/app/serializers/rest/media_attachment_serializer.rb @@ -4,7 +4,7 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer include RoutingHelper attributes :id, :type, :url, :preview_url, - :remote_url, :text_url, :meta, + :remote_url, :preview_remote_url, :text_url, :meta, :description, :blurhash def id @@ -35,6 +35,10 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer end end + def preview_remote_url + object.thumbnail_remote_url.presence + end + def text_url object.local? ? medium_url(object) : nil end |