From a130b843a9ae7533c650c05bc371650147cd4441 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 14 Aug 2020 16:32:56 +0200 Subject: Correct check for mp3 --- ui/commands.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/commands.go b/ui/commands.go index 3636c5b..59bfe6f 100644 --- a/ui/commands.go +++ b/ui/commands.go @@ -467,7 +467,9 @@ func fileGetContentType(filePath string) (string, error) { return "", err } - if len(buffer) >= 3 && (buffer[0] == 0xFF && (buffer[1] == 0xFB || buffer[1] == 0xF3 || buffer[1] == 0xF2)) || string(buffer[0:3]) == "ID3" { + if len(buffer) >= 3 && buffer[0] == 0xFF && (buffer[1] == 0xFB || buffer[1] == 0xF3 || buffer[1] == 0xF2) { + return "audio/mpeg", nil + } else if len(buffer) >= 3 && string(buffer[0:3]) == "ID3" { return "audio/mpeg", nil } -- cgit v1.2.3