Add a default name for media if none is specified in AP

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-11-10 16:39:22 +01:00
parent 41bddebda2
commit 6822cfabf1
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -66,6 +66,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Media do
end
@spec upload_media(String.t(), String.t()) :: {:ok, map()} | {:error, atom() | String.t()}
defp upload_media(media_url, ""), do: upload_media(media_url, "unknown")
defp upload_media(media_url, name) do
case Tesla.get(media_url, opts: @http_options) do
{:ok, %{body: body}} ->