diff options
author | Hakaba Hitoyo <hakabahitoyo@example.com> | 2018-11-15 14:19:10 +0900 |
---|---|---|
committer | Hakaba Hitoyo <hakabahitoyo@example.com> | 2018-11-15 14:19:10 +0900 |
commit | 58af0787be605d0b382b30aba3749c7c8bbf10bc (patch) | |
tree | 46da95065a9babecf5c2239a607ccf9447aea222 /lib | |
parent | 5c8b8f6cb7212bd202924b535cd2a263416e78d4 (diff) | |
download | pleroma-58af0787be605d0b382b30aba3749c7c8bbf10bc.tar.gz |
add mdii uploader
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/uploaders/mdii.ex | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/pleroma/uploaders/mdii.ex b/lib/pleroma/uploaders/mdii.ex new file mode 100644 index 000000000..3cf71df43 --- /dev/null +++ b/lib/pleroma/uploaders/mdii.ex @@ -0,0 +1,19 @@ +defmodule Pleroma.Uploaders.Mdii do + @behaviour Pleroma.Uploaders.Uploader + + def put_file(name, uuid, path, content_type, _should_dedupe) do + settings = Application.get_env(:pleroma, Pleroma.Uploaders.Mdii) + host_name = Keyword.fetch!(settings, :host_name) + + {:ok, file_data} = File.read(path) + + File.rm!(path) + + remote_file_name = "00000" + extension = "png" + + public_url = "https://#{host_name}/#{remote_file_name}.#{extension}" + + {:ok, public_url} + end +end |