commit: 2a47156b87c668d11f3f2eeee5782472c12c5279
parent 86bcb87e6c58797387934cbda5ec14b81f3f5f1d
Author: Mark Felder <feld@feld.me>
Date: Wed, 9 Jun 2021 11:06:53 -0500
Lint
Diffstat:
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/lib/pleroma/web/metadata/providers/open_graph.ex b/lib/pleroma/web/metadata/providers/open_graph.ex
@@ -37,7 +37,8 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
] ++
if attachments == [] or Metadata.activity_nsfw?(object) do
[
- {:meta, [property: "og:image", content: MediaProxy.preview_url(User.avatar_url(user))], []},
+ {:meta, [property: "og:image", content: MediaProxy.preview_url(User.avatar_url(user))],
+ []},
{:meta, [property: "og:image:width", content: 150], []},
{:meta, [property: "og:image:height", content: 150], []}
]
@@ -58,7 +59,8 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
{:meta, [property: "og:url", content: user.uri || user.ap_id], []},
{:meta, [property: "og:description", content: truncated_bio], []},
{:meta, [property: "og:type", content: "article"], []},
- {:meta, [property: "og:image", content: MediaProxy.preview_url(User.avatar_url(user))], []},
+ {:meta, [property: "og:image", content: MediaProxy.preview_url(User.avatar_url(user))],
+ []},
{:meta, [property: "og:image:width", content: 150], []},
{:meta, [property: "og:image:height", content: 150], []}
]
@@ -130,11 +132,11 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
cond do
Pleroma.Config.get([:media_preview_proxy, :enabled], false) ->
metadata ++
- [
- {:meta, [property: "og:image:width", content: "#{url["width"]}"], []},
- {:meta, [property: "og:image:height", content: "#{url["height"]}"], []},
- {:meta, [property: "og:image", content: MediaProxy.preview_url(url["href"])], []}
- ]
+ [
+ {:meta, [property: "og:image:width", content: "#{url["width"]}"], []},
+ {:meta, [property: "og:image:height", content: "#{url["height"]}"], []},
+ {:meta, [property: "og:image", content: MediaProxy.preview_url(url["href"])], []}
+ ]
true ->
metadata
diff --git a/lib/pleroma/web/metadata/providers/twitter_card.ex b/lib/pleroma/web/metadata/providers/twitter_card.ex
@@ -93,7 +93,8 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCard do
{:meta, [property: "twitter:player", content: player_url(id)], []},
{:meta, [property: "twitter:player:width", content: "#{width}"], []},
{:meta, [property: "twitter:player:height", content: "#{height}"], []},
- {:meta, [property: "twitter:player:stream", content: MediaProxy.url(url["href"])], []},
+ {:meta, [property: "twitter:player:stream", content: MediaProxy.url(url["href"])],
+ []},
{:meta,
[property: "twitter:player:stream:content_type", content: url["mediaType"]], []}
| acc