Commit Graph

11 Commits

Author SHA1 Message Date
ilja 9d8ab46cd6 Move building of url to modules
ci/woodpecker/pr/woodpecker Pipeline is pending Details
We got a path and there's a "base_url" function. With that the url was
build. But not all url's are nessecarely build like this. Building the
url should be the responsability of the Uploader itself, so it's now
moved to there.
2023-03-27 09:25:44 +02:00
ilja 2edb0944ba Return the complete `upload` from Pleroma.Uploaders.put_file/2
ci/woodpecker/pr/woodpecker Pipeline is pending Details
To move more logic to the Uploader modules, it's better to keep the same
`upload` and manipulate that while going through the upload pipeline, so
that's how it's now done.

Since we expect the `upload`, I removed the option for returning just `:ok`
from the uploaders.

It was possible to bypass the logic in the `get_url` function, but that was
unused. Since it makes even less sense when returning `upload`, I removed that
In a later stage I want to return the url from the uploader module, which
should obsolete this function.

I saw a warning from `Pleroma.Upload.Filter.MogrifyTest` which I now fixed.
2023-03-26 15:26:11 +02:00
ilja 053276ef6c Refactor upload, get url from modules
ci/woodpecker/pr/woodpecker Pipeline is pending Details
To get the url and base url, we had a function in upload.ex.
This included a `case` to check on what module is used.
This means that adding a new upload module implies changing code besides just adding a new module.

Here we try to get the logic properly into the respective modules.
This doesn't add new functionality, but should make it easier to add new uploaders in the future.
2023-03-12 10:13:07 +01:00
floatingghost 2641dcdd15 Post editing (#202)
ci/woodpecker/push/woodpecker Pipeline was successful Details
Rebased from #103

Co-authored-by: Tusooa Zhu <tusooa@kazv.moe>
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: #202
2022-09-06 19:24:02 +00:00
feld 2926713fe5 Merge branch 'deprecate-public_endpoint' into 'develop'
Deprecate Uploaders.S3, :public_endpoint

See merge request pleroma/pleroma!3251
2021-01-20 22:48:48 +00:00
Haelwenn (lanodan) Monnier c4439c630f
Bump Copyright to 2021
grep -rl '# Copyright © .* Pleroma' * | xargs sed -i 's;Copyright © .* Pleroma .*;Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>;'
2021-01-13 07:49:50 +01:00
Mark Felder 67e888498c Switch another test to Upload.base_url/0 2021-01-12 16:42:43 -06:00
Mark Felder e87cca97e6 Fix tests relying on old behavior. Use the Upload.base_url, Luke. 2021-01-12 16:35:10 -06:00
Mark Felder 40f3cdc030 JPEG content_type must be image/jpeg 2020-10-13 10:37:24 -05:00
Mark Felder b738f70953 Merge branch 'develop' into feature/gen-magic 2020-10-13 10:08:38 -05:00
Alexander Strizhakov 7dffaef479
tests consistency 2020-10-13 16:35:09 +03:00
Renamed from test/upload_test.exs (Browse further)