Fix another ad-hoc construction of the upload base_url

This commit is contained in:
Mark Felder 2021-01-12 16:32:52 -06:00
parent 8b28dce82a
commit 12528edc34
1 changed files with 2 additions and 14 deletions

View File

@ -131,12 +131,7 @@ defp get_opts(opts) do
uploader: Keyword.get(opts, :uploader, Pleroma.Config.get([__MODULE__, :uploader])), uploader: Keyword.get(opts, :uploader, Pleroma.Config.get([__MODULE__, :uploader])),
filters: Keyword.get(opts, :filters, Pleroma.Config.get([__MODULE__, :filters])), filters: Keyword.get(opts, :filters, Pleroma.Config.get([__MODULE__, :filters])),
description: Keyword.get(opts, :description), description: Keyword.get(opts, :description),
base_url: base_url: base_url()
Keyword.get(
opts,
:base_url,
Pleroma.Config.get([__MODULE__, :base_url], Pleroma.Web.base_url())
)
} }
end end
@ -217,14 +212,7 @@ defp url_from_spec(%__MODULE__{name: name}, base_url, {:file, path}) do
"" ""
end end
prefix = [base_url, path]
if is_nil(Pleroma.Config.get([__MODULE__, :base_url])) do
"media"
else
""
end
[base_url, prefix, path]
|> Path.join() |> Path.join()
end end