dedupe: extract audio-mime crate for content_type_to_extension#4152
Merged
dedupe: extract audio-mime crate for content_type_to_extension#4152
Conversation
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>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote-storybook canceled.
|
✅ Deploy Preview for hyprnote canceled.
|
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
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>
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
content_type_to_extension(maps MIME content types likeaudio/wavto file extensions) was duplicated identically in two crates:transcribe-cactus/src/service/batch/audio.rstranscribe-proxy/src/routes/batch/mod.rsThis PR creates a new zero-dependency
crates/audio-mimecrate to hold the function, avoiding the need to promote the heavyhypr-audio-utils(which pullsrodio,symphonia-all,rubato, etc.) intotranscribe-proxy's production dependencies.How it works
crates/audio-mime— new crate, zero dependencies, ownscontent_type_to_extension+ testscrates/audio-utils— re-exports viapub use hypr_audio_mime::content_type_to_extensionfor backward compatibilitytranscribe-proxy— depends on the lightweightaudio-mimedirectlytranscribe-cactus— uses the re-export throughaudio-utils(already a production dep)Both duplicate definitions and their tests are removed from the consumer crates.
Review & Testing Checklist for Human
transcribe-cactusaccesses the function viahypr_audio_utils::content_type_to_extension(apub usere-export fromaudio-mime). Verify this is acceptable vs. addingaudio-mimeas a direct dep there too.audio-mimerelies on the existingcrates/*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 forcontent_type_to_extensionacross the repo should confirm no stale copies remain.Notes
plugins/listener2andcrates/audio-utilswere reviewed but neither had any content-type logic — listener2 works with file paths directly.