forked from AkkomaGang/akkoma
Avoid duplicate Config calls
This commit is contained in:
parent
3c936061d5
commit
530fb5b29e
1 changed files with 3 additions and 2 deletions
|
@ -233,6 +233,7 @@ defp url_from_spec(_upload, _base_url, {:url, url}), do: url
|
||||||
def base_url do
|
def base_url do
|
||||||
uploader = Config.get([Pleroma.Upload, :uploader])
|
uploader = Config.get([Pleroma.Upload, :uploader])
|
||||||
upload_base_url = Config.get([Pleroma.Upload, :base_url])
|
upload_base_url = Config.get([Pleroma.Upload, :base_url])
|
||||||
|
public_endpoint = Config.get([uploader, :public_endpoint])
|
||||||
|
|
||||||
case uploader do
|
case uploader do
|
||||||
Pleroma.Uploaders.Local ->
|
Pleroma.Uploaders.Local ->
|
||||||
|
@ -246,8 +247,8 @@ def base_url do
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
cond do
|
cond do
|
||||||
!is_nil(Config.get([uploader, :public_endpoint])) ->
|
!is_nil(public_endpoint) ->
|
||||||
Config.get([uploader, :public_endpoint])
|
public_endpoint
|
||||||
|
|
||||||
true ->
|
true ->
|
||||||
upload_base_url
|
upload_base_url
|
||||||
|
|
Loading…
Reference in a new issue