diff options
author | rinpatch <rinpatch@sdf.org> | 2018-11-27 14:34:29 +0300 |
---|---|---|
committer | rinpatch <rinpatch@airmail.cc> | 2018-11-27 17:51:02 +0300 |
commit | 7f20a3cf1fc9655056382c403f835a1bf57b8be2 (patch) | |
tree | fa89fc1135f6912ce76156083fe8f4ffd43644f6 /lib/pleroma/upload.ex | |
parent | cc45797f4e1765f5123c058166f6032c6a6556a0 (diff) | |
download | pleroma-7f20a3cf1fc9655056382c403f835a1bf57b8be2.tar.gz |
Add Theora detection to upload.ex
Diffstat (limited to 'lib/pleroma/upload.ex')
-rw-r--r-- | lib/pleroma/upload.ex | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pleroma/upload.ex b/lib/pleroma/upload.ex index 89aa779f9..9dcd9987a 100644 --- a/lib/pleroma/upload.ex +++ b/lib/pleroma/upload.ex @@ -162,7 +162,12 @@ defmodule Pleroma.Upload do "audio/mpeg" <<0x4F, 0x67, 0x67, 0x53, 0x00, 0x02, 0x00, 0x00>> -> - "audio/ogg" + case IO.binread(f, 27) do + <<_::size(160), 0x80, 0x74,0x68,0x65,0x6f,0x72,0x61>> -> + "video/ogg" + _ -> + "audio/ogg" + end <<0x52, 0x49, 0x46, 0x46, _, _, _, _>> -> "audio/wav" |