|
@ -4,7 +4,7 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer |
|
|
include RoutingHelper |
|
|
include RoutingHelper |
|
|
|
|
|
|
|
|
attributes :id, :type, :url, :preview_url, |
|
|
attributes :id, :type, :url, :preview_url, |
|
|
:remote_url, :text_url, :meta, |
|
|
|
|
|
|
|
|
:remote_url, :preview_remote_url, :text_url, :meta, |
|
|
:description, :blurhash |
|
|
:description, :blurhash |
|
|
|
|
|
|
|
|
def id |
|
|
def id |
|
@ -35,6 +35,10 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def preview_remote_url |
|
|
|
|
|
object.thumbnail_remote_url.presence |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
def text_url |
|
|
def text_url |
|
|
object.local? ? medium_url(object) : nil |
|
|
object.local? ? medium_url(object) : nil |
|
|
end |
|
|
end |
|
|