Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
2254e5e5
Commit
2254e5e5
authored
Nov 11, 2020
by
feld
Browse files
Render blurhashes in Mastodon API
parent
6fd72e9e
Pipeline
#32769
failed with stages
in 18 minutes and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/mastodon_api/views/status_view.ex
View file @
2254e5e5
...
...
@@ -435,7 +435,8 @@ def render("attachment.json", %{attachment: attachment}) do
text_url:
href
,
type:
type
,
description:
attachment
[
"name"
],
pleroma:
%{
mime_type:
media_type
}
pleroma:
%{
mime_type:
media_type
},
blurhash:
attachment
[
"blurhash"
]
}
end
...
...
test/pleroma/web/mastodon_api/views/status_view_test.exs
View file @
2254e5e5
...
...
@@ -420,6 +420,7 @@ test "attachments" do
"href"
=>
"someurl"
}
],
"blurhash"
=>
"UJJ8X[xYW,%Jtq%NNFbXB5j]IVM|9GV=WHRn"
,
"uuid"
=>
6
}
...
...
@@ -431,7 +432,8 @@ test "attachments" do
preview_url:
"someurl"
,
text_url:
"someurl"
,
description:
nil
,
pleroma:
%{
mime_type:
"image/png"
}
pleroma:
%{
mime_type:
"image/png"
},
blurhash:
"UJJ8X[xYW,%Jtq%NNFbXB5j]IVM|9GV=WHRn"
}
api_spec
=
Pleroma
.
Web
.
ApiSpec
.
spec
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment