Addressed deprecation warnings

This commit is contained in:
Kieran Eglin 2024-06-13 09:53:44 -07:00
parent f1ef8d3d54
commit c3062e73a4
No known key found for this signature in database
GPG key ID: 193984967FCF432D
2 changed files with 2 additions and 2 deletions

View file

@ -49,7 +49,7 @@ defmodule Pinchflat.Metadata.MetadataFileHelpers do
Returns {:ok, map()} | {:error, any} Returns {:ok, map()} | {:error, any}
""" """
def read_compressed_metadata(filepath) do def read_compressed_metadata(filepath) do
{:ok, json} = File.open(filepath, [:read, :compressed], &IO.read(&1, :all)) {:ok, json} = File.open(filepath, [:read, :compressed], &IO.read(&1, :eof))
Phoenix.json_library().decode(json) Phoenix.json_library().decode(json)
end end

View file

@ -32,7 +32,7 @@ defmodule Pinchflat.Metadata.MetadataFileHelpersTest do
metadata_map = %{"foo" => "bar"} metadata_map = %{"foo" => "bar"}
filepath = Helpers.compress_and_store_metadata_for(media_item, metadata_map) filepath = Helpers.compress_and_store_metadata_for(media_item, metadata_map)
{:ok, json} = File.open(filepath, [:read, :compressed], &IO.read(&1, :all)) {:ok, json} = File.open(filepath, [:read, :compressed], &IO.read(&1, :eof))
assert json == Phoenix.json_library().encode!(metadata_map) assert json == Phoenix.json_library().encode!(metadata_map)
end end