X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmedia_proxy%2Finvalidation.ex;h=cb2db5ce9ddef7c5179eac190546d920f9eec681;hb=1885268c9c242aca2a51bd15ed839bd65d6a52dc;hp=6da7eb720ac9349ad01bdc567d1ddb4dae438619;hpb=74fd761637f737822d01aed945b6e0c75ced7008;p=akkoma
diff --git a/lib/pleroma/web/media_proxy/invalidation.ex b/lib/pleroma/web/media_proxy/invalidation.ex
index 6da7eb720..cb2db5ce9 100644
--- a/lib/pleroma/web/media_proxy/invalidation.ex
+++ b/lib/pleroma/web/media_proxy/invalidation.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MediaProxy.Invalidation do
@@ -26,12 +26,15 @@ defmodule Pleroma.Web.MediaProxy.Invalidation do
defp do_purge(urls) do
provider = Config.get([:media_proxy, :invalidation, :provider])
- provider.purge(urls, Config.get(provider))
+ options = Config.get(provider)
+ provider.purge(urls, options)
end
def prepare_urls(urls) do
urls
|> List.wrap()
- |> Enum.map(&MediaProxy.url/1)
+ |> Enum.map(fn url -> [MediaProxy.url(url), MediaProxy.preview_url(url)] end)
+ |> List.flatten()
+ |> Enum.uniq()
end
end