projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle empty shortcode/filename/new_shortcode/new_filename
[akkoma]
/
lib
/
pleroma
/
emoji.ex
diff --git
a/lib/pleroma/emoji.ex
b/lib/pleroma/emoji.ex
index f56b26da25f093bb4643b425bd8efb8c049cd606..170a7d0980d38fb9925bb905e5d26b7f02636fdc 100644
(file)
--- a/
lib/pleroma/emoji.ex
+++ b/
lib/pleroma/emoji.ex
@@
-146,12
+146,12
@@
defmodule Pleroma.Emoji do
defp load_pack(pack_dir, emoji_groups) do
pack_name = Path.basename(pack_dir)
defp load_pack(pack_dir, emoji_groups) do
pack_name = Path.basename(pack_dir)
- pack_
yaml = Path.join(pack_dir, "pack.yml
")
+ pack_
file = Path.join(pack_dir, "pack.json
")
- if File.exists?(pack_
yaml
) do
-
yaml = RelaxYaml.Decoder.read_from_file(pack_yaml
)
+ if File.exists?(pack_
file
) do
+
contents = Jason.decode!(File.read!(pack_file)
)
-
yaml
["files"]
+
contents
["files"]
|> Enum.map(fn {name, rel_file} ->
filename = Path.join("/emoji/#{pack_name}", rel_file)
{name, filename, pack_name}
|> Enum.map(fn {name, rel_file} ->
filename = Path.join("/emoji/#{pack_name}", rel_file)
{name, filename, pack_name}