Skip to content

Comments

dedupe: extract audio-mime crate for content_type_to_extension#4152

Merged
yujonglee merged 6 commits intomainfrom
devin/1771740016-dedupe-content-type-to-extension
Feb 22, 2026
Merged

dedupe: extract audio-mime crate for content_type_to_extension#4152
yujonglee merged 6 commits intomainfrom
devin/1771740016-dedupe-content-type-to-extension

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 22, 2026

Summary

content_type_to_extension (maps MIME content types like audio/wav to file extensions) was duplicated identically in two crates:

  • transcribe-cactus/src/service/batch/audio.rs
  • transcribe-proxy/src/routes/batch/mod.rs

This PR creates a new zero-dependency crates/audio-mime crate to hold the function, avoiding the need to promote the heavy hypr-audio-utils (which pulls rodio, symphonia-all, rubato, etc.) into transcribe-proxy's production dependencies.

How it works

  • crates/audio-mime — new crate, zero dependencies, owns content_type_to_extension + tests
  • crates/audio-utils — re-exports via pub use hypr_audio_mime::content_type_to_extension for backward compatibility
  • transcribe-proxy — depends on the lightweight audio-mime directly
  • transcribe-cactus — uses the re-export through audio-utils (already a production dep)

Both duplicate definitions and their tests are removed from the consumer crates.

Review & Testing Checklist for Human

  • Re-export indirection in transcribe-cactus: transcribe-cactus accesses the function via hypr_audio_utils::content_type_to_extension (a pub use re-export from audio-mime). Verify this is acceptable vs. adding audio-mime as a direct dep there too.
  • Workspace glob pickup: audio-mime relies on the existing crates/* workspace member glob — confirm the new crate is discovered correctly in all build environments.

Suggested test plan: CI passes for all affected crates (audio-mime, audio-utils, transcribe-proxy, transcribe-cactus). No runtime behavior change — the function logic is identical to the removed copies. A quick grep for content_type_to_extension across the repo should confirm no stale copies remain.

Notes

  • plugins/listener2 and crates/audio-utils were reviewed but neither had any content-type logic — listener2 works with file paths directly.
  • Devin run | Requested by @yujonglee

Remove duplicate implementations from transcribe-cactus and
transcribe-proxy, re-exporting the single copy from hypr_audio_utils.

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Feb 22, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit dee4d46
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/699aa20ef8b04f0008f94884

@netlify
Copy link

netlify bot commented Feb 22, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit dee4d46
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/699aa20e0b2f7700081aaeea

devin-ai-integration bot and others added 2 commits February 22, 2026 06:04
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Copy link
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

devin-ai-integration bot and others added 2 commits February 22, 2026 06:21
Instead of promoting hypr-audio-utils (which pulls rodio, rubato, etc.)
to a production dependency of transcribe-proxy, create a zero-dep
audio-mime crate with just content_type_to_extension.

- transcribe-proxy depends on the lightweight audio-mime crate
- audio-utils re-exports from audio-mime for backward compatibility
- transcribe-cactus continues using audio-utils (already a dep)

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title dedupe: move content_type_to_extension to crates/audio-utils dedupe: extract audio-mime crate for content_type_to_extension Feb 22, 2026
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@yujonglee yujonglee merged commit 1ebeebc into main Feb 22, 2026
23 checks passed
@yujonglee yujonglee deleted the devin/1771740016-dedupe-content-type-to-extension branch February 22, 2026 07:02
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