From 8e707aba29921666a50878c39751cd53ee5cde7e Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Thu, 15 Nov 2018 15:11:59 +0900 Subject: [PATCH] format --- config/config.exs | 3 +-- lib/pleroma/uploaders/mdii.ex | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/config/config.exs b/config/config.exs index ef69368e6..f222c1aa4 100644 --- a/config/config.exs +++ b/config/config.exs @@ -23,8 +23,7 @@ public_endpoint: "https://s3.amazonaws.com", force_media_proxy: false -config :pleroma, Pleroma.Uploaders.Mdii, - host_name: "mdii.sakura.ne.jp" +config :pleroma, Pleroma.Uploaders.Mdii, host_name: "mdii.sakura.ne.jp" config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"] diff --git a/lib/pleroma/uploaders/mdii.ex b/lib/pleroma/uploaders/mdii.ex index 0f68b0805..c5deaf73f 100644 --- a/lib/pleroma/uploaders/mdii.ex +++ b/lib/pleroma/uploaders/mdii.ex @@ -10,12 +10,11 @@ def put_file(name, uuid, path, content_type, _should_dedupe) do {:ok, file_data} = File.read(path) File.rm!(path) - + extension = Regex.replace(~r/^image\//, content_type, "") query = "https://#{host_name}/mdii.cgi?#{extension}" - with {:ok, %{status_code: 200, body: body}} <- - @httpoison.post(query, file_data) do + with {:ok, %{status_code: 200, body: body}} <- @httpoison.post(query, file_data) do remote_file_name = body public_url = "https://#{host_name}/#{remote_file_name}.#{extension}" {:ok, public_url}