Repository navigation
fix(playback): honor device audio language selection - #596
Conversation
📝 WalkthroughWalkthroughThe change propagates normalized device IDs through web playback requests, access filters, catalog audio resolution, and Playback V3. Canonical settings now control device-aware audio selection. Playback attempt digests support device identity and legacy replay compatibility. ChangesDevice-scoped audio playback
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant PlaybackV3
participant Catalog
participant SettingsResolver
Client->>PlaybackV3: Start playback with device ID
PlaybackV3->>PlaybackV3: Normalize device ID and compute digests
PlaybackV3->>Catalog: Resolve preferred audio track
Catalog->>SettingsResolver: Resolve canonical audio language
SettingsResolver-->>Catalog: Return language by precedence
Catalog-->>PlaybackV3: Return selected track
PlaybackV3-->>Client: Return playback response or replay conflict
Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95adf18daf
ℹ️ 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".
95adf18 to
0853aff
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0853aff417
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/api/handlers/playback_v3.go`:
- Around line 510-533: Restrict legacy digest matching in
playbackStartRequestDigestsV3.matches to requests with no device ID: retain
current-digest matching for all requests, but only accept the empty or body-only
legacy digest when the originating request’s device identity is also empty.
Update the digest type or matching flow to retain that identity context, and add
coverage proving a legacy digest retried with a different device ID is rejected
as playback_attempt_reused.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2cef4970-ffd8-4ff8-bb56-da526d864cd5
📒 Files selected for processing (12)
internal/api/handlers/playback_v3.gointernal/api/handlers/playback_v3_test.goweb/src/api/client.tsweb/src/pages/audiobooks/player/audiobookPlaybackContext.tsxweb/src/pages/audiobooks/player/useAudiobookPlayback.test.tsweb/src/playback/WatchPlaybackChrome.tsxweb/src/player/components/VideoPlayer.test.tsxweb/src/player/components/WatchPage.test.tsweb/src/player/context/PlayerConfigContext.tsxweb/src/player/hooks/usePlaybackSession.test.tsweb/src/player/player-fetch.test.tsweb/src/player/player-fetch.ts
Summary
X-Silo-Device-Ididentity into catalog detail preference resolutionplayback.audio_languagethrough the canonical settings context for series, library, device, and profile scopesApple already writes its audio-language picker to
profile_device. The server previously omitted the device ID when computing botheffective_audio_track_indexand an omitted Playback V3 audio track, so Apple’s saved setting could never win.Fixes #595
Part of #376
Validation
go test ./internal/catalog ./internal/api/handlersmake verify-local-pathscd web && pnpm exec vitest run src/player/player-fetch.test.tscd web && pnpm run buildcd web && pnpm run lint(zero errors; existing warnings remain)cd web && pnpm run format:checkgit diff --check origin/main...HEADmake test-goran across the repository; the changed packages pass. The run still hits the two existing Jellycompat process-lock failures, which reproduce on an untouchedorigin/maincheckout. Three concurrent NVENC probe tests also failed in that full run but pass when rerun directly on both this branch andorigin/main.AI Disclosure
Summary by CodeRabbit
New Features
Bug Fixes