better config reading
This commit is contained in:
parent
55abd8482e
commit
8fd0556c78
|
@ -23,7 +23,7 @@
|
|||
public_endpoint: "https://s3.amazonaws.com",
|
||||
force_media_proxy: false
|
||||
|
||||
config :pleroma, Pleroma.Uploaders.Mdii,
|
||||
config :pleroma, Pleroma.Uploaders.MDII,
|
||||
cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
|
||||
files: "https://mdii.sakura.ne.jp"
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
defmodule Pleroma.Uploaders.Mdii do
|
||||
defmodule Pleroma.Uploaders.MDII do
|
||||
alias Pleroma.Config
|
||||
|
||||
@behaviour Pleroma.Uploaders.Uploader
|
||||
|
||||
@httpoison Application.get_env(:pleroma, :httpoison)
|
||||
|
||||
def put_file(name, uuid, path, content_type, _should_dedupe) do
|
||||
settings = Application.get_env(:pleroma, Pleroma.Uploaders.Mdii)
|
||||
cgi = Keyword.fetch!(settings, :cgi)
|
||||
files = Keyword.fetch!(settings, :files)
|
||||
cgi = Pleroma.Config.get([Pleroma.Uploaders.MDII, :cgi])
|
||||
files = Pleroma.Config.get([Pleroma.Uploaders.MDII, :files])
|
||||
|
||||
{:ok, file_data} = File.read(path)
|
||||
|
||||
|
|
Loading…
Reference in New Issue