transmogrifier: When it’s a Video move "url" to "attachment"
This commit is contained in:
parent
093d39b634
commit
3aff8067e4
|
@ -69,8 +69,8 @@ def contain_origin_from_id(id, %{"id" => other_id} = _params) do
|
||||||
def fix_object(object) do
|
def fix_object(object) do
|
||||||
object
|
object
|
||||||
|> fix_actor
|
|> fix_actor
|
||||||
|> fix_attachments
|
|
||||||
|> fix_url
|
|> fix_url
|
||||||
|
|> fix_attachments
|
||||||
|> fix_context
|
|> fix_context
|
||||||
|> fix_in_reply_to
|
|> fix_in_reply_to
|
||||||
|> fix_emoji
|
|> fix_emoji
|
||||||
|
@ -200,8 +200,14 @@ def fix_url(%{"url" => url} = object) when is_list(url) do
|
||||||
true -> ""
|
true -> ""
|
||||||
end
|
end
|
||||||
|
|
||||||
object
|
if Map.get(object, "type") == "Video" do
|
||||||
|> Map.put("url", url_string)
|
object
|
||||||
|
|> Map.delete("url")
|
||||||
|
|> Map.put("attachment", url_string)
|
||||||
|
else
|
||||||
|
object
|
||||||
|
|> Map.put("url", url_string)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def fix_url(object), do: object
|
def fix_url(object), do: object
|
||||||
|
|
Loading…
Reference in New Issue