URL passed to helper is already MediaProxy
authorMark Felder <feld@FreeBSD.org>
Thu, 3 Sep 2020 20:28:57 +0000 (15:28 -0500)
committerMark Felder <feld@FreeBSD.org>
Thu, 3 Sep 2020 20:28:57 +0000 (15:28 -0500)
Set :preview pool on the request

lib/pleroma/helpers/media_helper.ex

index 9bd815c26220705f7623d994b33c59bf5db59ad2..cfb091f8252507e7807adc3f6531fba360db339d 100644 (file)
@@ -12,8 +12,7 @@ defmodule Pleroma.Helpers.MediaHelper do
   def image_resize(url, options) do
     with executable when is_binary(executable) <- System.find_executable("convert"),
          {:ok, args} <- prepare_image_resize_args(options),
-         url = Pleroma.Web.MediaProxy.url(url),
-         {:ok, env} <- Pleroma.HTTP.get(url),
+         {:ok, env} <- Pleroma.HTTP.get(url, [], [adapter: [pool: :preview]]),
          {:ok, fifo_path} <- mkfifo() do
       args = List.flatten([fifo_path, args])
       run_fifo(fifo_path, env, executable, args)
@@ -61,8 +60,7 @@ defmodule Pleroma.Helpers.MediaHelper do
 
   def video_framegrab(url) do
     with executable when is_binary(executable) <- System.find_executable("ffmpeg"),
-         url = Pleroma.Web.MediaProxy.url(url),
-         {:ok, env} <- Pleroma.HTTP.get(url),
+         {:ok, env} <- Pleroma.HTTP.get(url, [], [adapter: [pool: :preview]]),
          {:ok, fifo_path} <- mkfifo(),
          args = [
            "-y",