From edf43d681f6f28bbaab1b4e8cbd195d36660d8f0 Mon Sep 17 00:00:00 2001 From: argenis de la rosa Date: Wed, 4 Mar 2026 13:29:03 -0500 Subject: [PATCH] fix(discord): treat application/ogg as audio for transcription --- src/channels/discord.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/channels/discord.rs b/src/channels/discord.rs index 8f07a7eef..0dfbfd11c 100644 --- a/src/channels/discord.rs +++ b/src/channels/discord.rs @@ -292,7 +292,9 @@ fn is_audio_attachment(content_type: &str, filename: &str, url: &str) -> bool { let normalized_content_type = normalize_content_type(content_type); if !normalized_content_type.is_empty() { - if normalized_content_type.starts_with("audio/") { + if normalized_content_type.starts_with("audio/") + || audio_extension_from_content_type(&normalized_content_type).is_some() + { return true; } // Trust explicit non-audio MIME to avoid false positives from filename extensions. @@ -2133,6 +2135,15 @@ mod tests { )); } + #[test] + fn is_audio_attachment_accepts_application_ogg_mime() { + assert!(is_audio_attachment( + "application/ogg", + "voice", + "https://cdn.discordapp.com/attachments/123/456/blob" + )); + } + #[test] fn infer_audio_filename_uses_content_type_when_name_lacks_extension() { let file_name = infer_audio_filename(