Render blurhashes in Mastodon API
authorMark Felder <feld@FreeBSD.org>
Wed, 11 Nov 2020 18:51:13 +0000 (12:51 -0600)
committerMark Felder <feld@FreeBSD.org>
Wed, 11 Nov 2020 18:51:13 +0000 (12:51 -0600)
lib/pleroma/web/mastodon_api/views/status_view.ex
test/pleroma/web/mastodon_api/views/status_view_test.exs

index 435bcde157552b063deb98a72829c3527e6ea60f..7cbbd3750468a2f0d9f75c1f204348d5e6755bf6 100644 (file)
@@ -435,7 +435,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       text_url: href,
       type: type,
       description: attachment["name"],
-      pleroma: %{mime_type: media_type}
+      pleroma: %{mime_type: media_type},
+      blurhash: attachment["blurhash"]
     }
   end
 
index 70d829979bb0cde71f47aec6fee8c92be1158196..665199f972349f9f42c5f24ce027e05e63a5c7cd 100644 (file)
@@ -420,6 +420,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
           "href" => "someurl"
         }
       ],
+      "blurhash" => "UJJ8X[xYW,%Jtq%NNFbXB5j]IVM|9GV=WHRn",
       "uuid" => 6
     }
 
@@ -431,7 +432,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest 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()