URL passed to helper is already MediaProxy

Set :preview pool on the request
This commit is contained in:
Mark Felder 2020-09-03 15:28:57 -05:00
parent b529616e11
commit f25b0e87f3
1 changed files with 2 additions and 4 deletions

View 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 @@ defp prepare_image_resize_args(_), do: {:error, :missing_options}
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",