is once created permanent and changing it (especially in uploaders) is probably a bad idea!
* `:tempfile` - path to the temporary file. Prefer in-place changes on the file rather than changing the
path as the temporary file is also tracked by `Plug.Upload{}` and automatically deleted once the request is over.
is once created permanent and changing it (especially in uploaders) is probably a bad idea!
* `:tempfile` - path to the temporary file. Prefer in-place changes on the file rather than changing the
path as the temporary file is also tracked by `Plug.Upload{}` and automatically deleted once the request is over.
- defstruct [:id, :name, :tempfile, :content_type, :path]
+ defstruct [:id, :name, :tempfile, :content_type, :width, :height, :blurhash, :path]
defp get_description(opts, upload) do
case {opts[:description], Pleroma.Config.get([Pleroma.Upload, :default_description])} do
defp get_description(opts, upload) do
case {opts[:description], Pleroma.Config.get([Pleroma.Upload, :default_description])} do
"mediaType" => upload.content_type,
"href" => url_from_spec(upload, opts.base_url, url_spec)
}
"mediaType" => upload.content_type,
"href" => url_from_spec(upload, opts.base_url, url_spec)
}
else
{:description_limit, _} ->
{:error, :description_too_long}
else
{:description_limit, _} ->
{:error, :description_too_long}
uploader: Keyword.get(opts, :uploader, Pleroma.Config.get([__MODULE__, :uploader])),
filters: Keyword.get(opts, :filters, Pleroma.Config.get([__MODULE__, :filters])),
description: Keyword.get(opts, :description),
uploader: Keyword.get(opts, :uploader, Pleroma.Config.get([__MODULE__, :uploader])),
filters: Keyword.get(opts, :filters, Pleroma.Config.get([__MODULE__, :filters])),
description: Keyword.get(opts, :description),
def base_url do
uploader = Config.get([Pleroma.Upload, :uploader])
upload_base_url = Config.get([Pleroma.Upload, :base_url])
def base_url do
uploader = Config.get([Pleroma.Upload, :uploader])
upload_base_url = Config.get([Pleroma.Upload, :base_url])
- true ->
- Pleroma.Web.base_url() <> "/media/"
- end
+ Pleroma.Uploaders.S3 ->
+ bucket = Config.get([Pleroma.Uploaders.S3, :bucket])
+ truncated_namespace = Config.get([Pleroma.Uploaders.S3, :truncated_namespace])
+ namespace = Config.get([Pleroma.Uploaders.S3, :bucket_namespace])
- _ ->
- cond do
- !is_nil(Config.get([uploader, :public_endpoint])) ->
- Config.get([uploader, :public_endpoint])
+ bucket_with_namespace =
+ cond do
+ !is_nil(truncated_namespace) ->
+ truncated_namespace