diff --git a/lib/pleroma/emoji/pack.ex b/lib/pleroma/emoji/pack.ex index 9b50fb74c..561bc69d8 100644 --- a/lib/pleroma/emoji/pack.ex +++ b/lib/pleroma/emoji/pack.ex @@ -252,9 +252,6 @@ defmodule Pleroma.Emoji.Pack do {_, {:ok, _}} <- {"Could not unzip pack", :zip.unzip(binary_archive, cwd: String.to_charlist(pack_path))} do - # Get the pack SHA - archive_sha = :crypto.hash(:sha256, binary_archive) |> Base.encode16() - pack_json_path = Path.join([pack_path, "pack.json"]) # Make a json if it does not exist if not File.exists?(pack_json_path) do @@ -265,6 +262,9 @@ defmodule Pleroma.Emoji.Pack do Map.get(opts, :exts, [".png", ".gif", ".jpg"]) ) + # Calculate the pack SHA. Only needed when there's no pack.json, as it would already include a hash + archive_sha = :crypto.hash(:sha256, binary_archive) |> Base.encode16() + pack_json = %{ pack: %{ license: Map.get(opts, :license, ""),