Merge upstream 2.0ish #165
This commit is contained in:
@@ -15,4 +15,8 @@ class REST::ApplicationSerializer < ActiveModel::Serializer
|
||||
def client_secret
|
||||
object.secret
|
||||
end
|
||||
|
||||
def website
|
||||
object.website.presence
|
||||
end
|
||||
end
|
||||
|
@@ -3,9 +3,13 @@
|
||||
class REST::CustomEmojiSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :shortcode, :url
|
||||
attributes :shortcode, :url, :static_url
|
||||
|
||||
def url
|
||||
full_asset_url(object.image.url)
|
||||
end
|
||||
|
||||
def static_url
|
||||
full_asset_url(object.image.url(:static))
|
||||
end
|
||||
end
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user