Skip to content

fix: normalize .wav MIME type to audio/wav#81

Open
ezynda3 wants to merge 1 commit into
masterfrom
fix-wav-mime-type
Open

fix: normalize .wav MIME type to audio/wav#81
ezynda3 wants to merge 1 commit into
masterfrom
fix-wav-mime-type

Conversation

@ezynda3

@ezynda3 ezynda3 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

System MIME databases vary: some return audio/x-wav for .wav, which causes TestDetectMediaType to fail on certain CI images. This change forces the canonical audio/wav type for .wav files so the test is deterministic across environments.

Summary by CodeRabbit

  • Bug Fixes
    • Improved recognition of WAV files so they are consistently treated as audio/WAV across the app.
    • This helps prevent incorrect file-type detection in workflows that rely on media identification.

System MIME databases vary: some return audio/x-wav for .wav, which causes TestDetectMediaType to fail on certain CI images. Force the canonical audio/wav type for .wav files so the test is deterministic across environments.
@mark-iii-labs-huly

Copy link
Copy Markdown

Connected to Huly®: KIT-82

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fcce93b4-7f4a-4e07-a9da-ad5ca252ab6a

📥 Commits

Reviewing files that changed from the base of the PR and between 4aa786f and 9abd091.

📒 Files selected for processing (1)
  • internal/ui/fileutil/processor.go

📝 Walkthrough

Walkthrough

In detectMediaType, a new early-exit branch checks if the file extension is .wav and immediately returns audio/wav, bypassing the existing mime.TypeByExtension logic and subsequent fallbacks.

Changes

WAV MIME Type Fix

Layer / File(s) Summary
.wav override in detectMediaType
internal/ui/fileutil/processor.go
Inserts an extension check at the top of detectMediaType that returns audio/wav for .wav files before any other MIME resolution.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A wav file hops in, seeking its type,
No longer lost in the MIME-lookup hype.
The rabbit said "Simple! audio/wav it shall be,"
One early return sets the audio file free. 🐇🎵

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely matches the change to normalize .wav MIME handling to audio/wav.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-wav-mime-type

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant