From cfabc5358c866d87c99b64a44fac44cf64a19931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sun, 23 Oct 2022 15:10:47 +0200 Subject: [PATCH] fix: .wavs also detected as audio --- src/extractors/media.rs | 5 ++++- webui/src/util/mediatypes.ts | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/extractors/media.rs b/src/extractors/media.rs index 7398098..763c7f9 100644 --- a/src/extractors/media.rs +++ b/src/extractors/media.rs @@ -87,7 +87,10 @@ impl Extractor for MediaExtractor { } if e.attribute == LABEL_ATTR { if let EntryValue::String(label) = &e.value { - return label.ends_with(".ogg") || label.ends_with(".mp3"); + let label = label.to_lowercase(); + return label.ends_with(".ogg") + || label.ends_with(".mp3") + || label.ends_with(".wav"); } } false diff --git a/webui/src/util/mediatypes.ts b/webui/src/util/mediatypes.ts index c6089ea..c5e08f8 100644 --- a/webui/src/util/mediatypes.ts +++ b/webui/src/util/mediatypes.ts @@ -11,8 +11,8 @@ export function getTypes(entity: UpObject, entityInfo: EntityInfo) { const audio = (["audio", "application/x-riff"].some((p) => mimeType.startsWith(p)) && !video) || - [".ogg", ".mp3"].some((suffix) => - entity?.identify().some((l) => l.endsWith(suffix)) + [".ogg", ".mp3", ".wav"].some((suffix) => + entity?.identify().some((l) => l.toLowerCase().endsWith(suffix)) ); const image = mimeType.startsWith("image"); const text = mimeType.startsWith("text");