From 2a7fbd96d55e1670d69a9886edc93d6773ce9864 Mon Sep 17 00:00:00 2001 From: Karen Shaw Date: Fri, 3 May 2024 19:36:03 +0000 Subject: [PATCH] Fix download_url api path --- app/lib/meadow/data/file_sets.ex | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/lib/meadow/data/file_sets.ex b/app/lib/meadow/data/file_sets.ex index d798e6af9..c17858bfb 100644 --- a/app/lib/meadow/data/file_sets.ex +++ b/app/lib/meadow/data/file_sets.ex @@ -214,10 +214,10 @@ defmodule Meadow.Data.FileSets do end def derivative_key(file_set) do - Path.join([ - "derivatives", - Pairtree.derivative_path(file_set.id) - ]) + Path.join([ + "derivatives", + Pairtree.derivative_path(file_set.id) + ]) end def download_uri_for(%FileSet{id: id, role: %{id: "X"}}), do: download_uri(id) @@ -225,12 +225,9 @@ defmodule Meadow.Data.FileSets do def download_uri_for(_), do: nil defp download_uri(id) do - with uri <- URI.parse(Application.get_env(:meadow, :dc_api) |> get_in([:v2, "base_url"])) do - uri - |> URI.merge("file-sets/" <> id <> "/download") - |> URI.to_string() + api_url = Application.get_env(:meadow, :dc_api) |> get_in([:v2, "base_url"]) + "#{api_url}/file-sets/#{id}/download" end -end defp multi_update(file_set_updates) do file_set_updates