Skip to content

Commit

Permalink
Merge pull request #3352 from nulib/deploy/staging
Browse files Browse the repository at this point in the history
Deploy v7.2.6 to production
  • Loading branch information
mbklein authored May 17, 2023
2 parents 6ba69df + cc077d2 commit 1685b1c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/lib/meadow/pipeline/actions/extract_exif_metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ defmodule Meadow.Pipeline.Actions.ExtractExifMetadata do
extracted_metadata =
case file_set.extracted_metadata do
nil -> %{exif: exif_metadata}
map -> Map.put(map, :exif, exif_metadata)
map -> map |> Map.delete("exif") |> Map.put(:exif, exif_metadata)
end

FileSets.update_file_set(file_set, %{extracted_metadata: extracted_metadata})
Expand Down
2 changes: 1 addition & 1 deletion app/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Code.require_file("lib/env.ex")
defmodule Meadow.MixProject do
use Mix.Project

@app_version "7.2.5"
@app_version "7.2.6"

def project do
[
Expand Down
19 changes: 19 additions & 0 deletions app/test/pipeline/actions/extract_exif_metadata_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,24 @@ defmodule Meadow.Pipeline.Actions.ExtractExifMetadataTest do

assert log =~ ~r/already complete without overwriting/
end

test "key collision", %{exif_file_set_id: file_set_id} do
with file_set <- FileSets.get_file_set!(file_set_id) do
extracted_metadata = put_in(file_set.extracted_metadata, ["exif", "value"], "bogus")
FileSets.update_file_set(file_set, %{extracted_metadata: extracted_metadata})
end

with %{extracted_metadata: subject} <- FileSets.get_file_set!(file_set_id) do
assert get_in(subject, ["exif", "value"]) == "bogus"
end

assert {:ok, %{id: ^file_set_id}, %{}} =
send_test_message(ExtractExifMetadata, %{file_set_id: file_set_id}, %{})

FileSets.get_file_set!(file_set_id)
|> Map.get(:extracted_metadata)
|> get_in(["exif", "value"])
|> assert_maps_equal(@exif, @keys)
end
end
end

0 comments on commit 1685b1c

Please sign in to comment.