projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '1304-user-info-deprecation' into 'develop'
[akkoma]
/
lib
/
pleroma
/
uploaders
/
local.ex
diff --git
a/lib/pleroma/uploaders/local.ex
b/lib/pleroma/uploaders/local.ex
index 434a6b51585689c83c317ed087fe089b7f146654..36b3c35ecdbbb48b4df021d3bdb7ce1d0d72a27e 100644
(file)
--- a/
lib/pleroma/uploaders/local.ex
+++ b/
lib/pleroma/uploaders/local.ex
@@
-1,15
+1,17
@@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Uploaders.Local do
@behaviour Pleroma.Uploaders.Uploader
defmodule Pleroma.Uploaders.Local do
@behaviour Pleroma.Uploaders.Uploader
- alias Pleroma.Web
-
def get_file(_) do
{:ok, {:static_dir, upload_path()}}
end
def put_file(upload) do
{local_path, file} =
def get_file(_) do
{:ok, {:static_dir, upload_path()}}
end
def put_file(upload) do
{local_path, file} =
- case Enum.reverse(
String.split(upload.path, "/", trim: true
)) do
+ case Enum.reverse(
Path.split(upload.path
)) do
[file] ->
{upload_path(), file}
[file] ->
{upload_path(), file}
@@
-21,7
+23,7
@@
defmodule Pleroma.Uploaders.Local do
result_file = Path.join(local_path, file)
result_file = Path.join(local_path, file)
-
unless
File.exists?(result_file) do
+
if not
File.exists?(result_file) do
File.cp!(upload.tempfile, result_file)
end
File.cp!(upload.tempfile, result_file)
end