fix: .wavs also detected as audio

feat/type-attributes
Tomáš Mládek 2022-10-23 15:10:47 +02:00
parent b5b05ed852
commit cfabc5358c
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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");