feat(planner): show per-title audio bitrate in title breakdown#101
Conversation
The Planner's Title Breakdown card showed only a video bitrate figure per title. Audio already factored into the disc capacity math (reserved out of the budget before any video allocation), but was never surfaced in the UI — leaving users unable to see how much of the disc budget their audio tracks were actually consuming. Changes: - Added `audio_bits_per_second` to `TitleBitrateAllocation` in `capacity.rs`; the value was already computed per-title in `estimate_title_audio_bitrate_bps` and available in the allocation closure — it just wasn't threaded through. - Mirrored `audioBitsPerSecond` in the TypeScript binding (`guest-js/index.ts`). - Planner title rows now display `X.XX Mbps audio` (or `NNN kbps audio`) alongside the existing video line, suppressed when `audioBitsPerSecond` is 0 (title with no asset/duration). - Updated the PlannerPage test fixture and added an assertion that the audio stat renders correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L3tSFK3P9vGwbNNtb4AYQG
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ae80c75ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {formatBitrate(titleRate.bitsPerSecond)} video | ||
| </span> | ||
| )} | ||
| {titleRate != null && titleRate.audioBitsPerSecond > 0 && ( |
There was a problem hiding this comment.
Hide audio bitrate for titles without duration
When a title has no assigned asset or an unknown-duration asset and no audio mappings, the capacity estimator still returns an allocation and estimate_title_audio_bitrate_bps supplies the 192 kbps silent-audio fallback, while the same allocation has bitsPerSecond set to 0 for duration <= 0. With this condition, Planner renders 192 kbps audio beside No asset/0:00 rows even though that audio is not counted in the estimate and there is no media to break down; gate this on a real duration/asset or emit audioBitsPerSecond: 0 for zero-duration allocations.
Useful? React with 👍 / 👎.
…#102) Codex follow-up to #101. ## Summary Titles with no assigned asset (duration = 0) were getting `audio_bits_per_second` set to the 192 kbps silent-fallback rate from `estimate_title_audio_bitrate_bps`, causing the Planner to display "192 kbps audio" next to "No asset / 0:00" rows even though that audio is never actually counted in the budget estimate. Fix: gate `audio_bits_per_second` on `duration > 0`, matching the same guard that already zeroes out `bits_per_second` for these rows in `allocate_title_bitrates`. ## Test plan - [ ] Title with no assigned asset → no audio stat shown in Planner breakdown. - [ ] Title with an assigned asset and audio mappings → audio stat still appears correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L3tSFK3P9vGwbNNtb4AYQG
Fixes #70.
Summary
TitleBitrateAllocationincapacity.rsgains anaudio_bits_per_secondfield — the value was already computed per-title byestimate_title_audio_bitrate_bpsand used to reserve disc budget, but was thrown away before the struct was returned.audioBitsPerSecondin the TypeScript binding (guest-js/index.ts).X.XX Mbps audio(orNNN kbps audio) alongside the existing video stat. The audio line is suppressed whenaudioBitsPerSecondis 0 (title with no asset).Test plan
448 kbps audionext to the video line for each title.🤖 Generated with Claude Code
https://claude.ai/code/session_01L3tSFK3P9vGwbNNtb4AYQG