diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 3ec5d8238..a91f62d6e 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -604,6 +604,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do def render("attachment.json", %{attachment: attachment}) do [attachment_url | _] = attachment["url"] + attachment_type = attachment["type"] media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image" href_remote = attachment_url["href"] href = href_remote |> MediaProxy.url() @@ -615,6 +616,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do String.contains?(media_type, "image") -> "image" String.contains?(media_type, "video") -> "video" String.contains?(media_type, "audio") -> "audio" + attachment_type in ~w[Audio Image Video] -> attachment_type |> String.downcase() true -> "unknown" end