aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-08-14 16:32:56 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-14 16:32:56 +0200
commita130b843a9ae7533c650c05bc371650147cd4441 (patch)
tree2c060c3d54cf78ee7a933e2c4e883737d45b8f23 /ui
parentdfc258f1da72fdff592ae298ce5eb3b0f6b5e9ce (diff)
Correct check for mp3
Diffstat (limited to 'ui')
-rw-r--r--ui/commands.go4
1 files changed, 3 insertions, 1 deletions
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
}