Skip to content

fix(tv): carry the audio the viewer actually chose, not the plan's - #177

Merged
RXWatcher merged 1 commit into
Silo-Server:mainfrom
RXWatcher:fix/audio-carry-and-replan
Aug 6, 2026
Merged

fix(tv): carry the audio the viewer actually chose, not the plan's#177
RXWatcher merged 1 commit into
Silo-Server:mainfrom
RXWatcher:fix/audio-carry-and-replan

Conversation

@RXWatcher

Copy link
Copy Markdown
Contributor

Integration damage on main, found by auditing the merged result rather than by reviewing either PR in isolation. Neither #170 nor #173 was wrong on its own — the defect only exists in the combination.

The user-visible bug

Pick a non-default audio track, let the episode auto-advance, and the next episode starts on the track you switched away from.

A direct-play local switch changes the mounted audio track without a server replan, so playbackPlan still names the previous one. advanceToNextEpisode labelled the carried track from playbackPlan.selectedTracks.audioIndex, so the handoff contradicted manualAudioSelectionApplied, which correctly said a choice had been made.

The confirmed desiredAudioOrdinal now takes precedence.

The same mistake one layer down

subtitlePlaybackContext derived its audio the same way, so any later subtitle, quality or output-route transaction replanned the viewer straight back onto the previous track.

The recovery replan already preferred the confirmed choice — this brings the transaction path in line with it, rather than inventing a third rule.

Merge tidy-up

Three KDocs ended up attached to the wrong declaration: PlayerTrackEntry's doc was stranded above an inserted helper, desiredAudioOrdinal accumulated two, and a stale one describes a backend counter that isn't the property beneath it.

Testing

Full suite green on all four modules with --rerun-tasks.

Not device-verified. The auto-advance path is testable on hardware — pick a non-default track, seek to the end, watch what the next episode starts on — and that is worth doing before trusting this.

🤖 Generated with Claude Code

https://claude.ai/code/session_0115uaQ6FTQZK8KYvazjefaW

Integration damage from merging the audio-selection work onto the player
work. Both defects have the same cause: a direct-play local switch changes
the mounted audio track WITHOUT a server replan, so playbackPlan still
names the previous track — and two paths read the plan as though it were
the record of what the viewer chose.

Auto-advance handed the next episode the wrong audio. advanceToNextEpisode
labelled the carried track from playbackPlan.selectedTracks.audioIndex, so
after a local switch the next episode started on the track the viewer had
just switched away from, while manualAudioSelectionApplied said a choice
had been made. Pick Japanese, let it roll on, get English. The confirmed
desiredAudioOrdinal now takes precedence.

Replans rebuilt the same stale choice. subtitlePlaybackContext derived its
audio the same way, so any later subtitle, quality or output-route
transaction replanned the viewer back onto the previous track. The
recovery replan already preferred the confirmed choice; this brings the
transaction path in line with it.

Also repairs three KDocs the merge left attached to the wrong declaration:
PlayerTrackEntry's doc had been stranded above an inserted helper,
desiredAudioOrdinal had accumulated two, and a stale one described a
backend counter that is not the property beneath it.

Found by auditing merged main for integration damage rather than by
reviewing either PR in isolation — neither was wrong on its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0115uaQ6FTQZK8KYvazjefaW
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@RXWatcher, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 18 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e336a3f3-6c44-4ef4-ab3a-d6e8c2c332d0

📥 Commits

Reviewing files that changed from the base of the PR and between e860b50 and 3654729.

📒 Files selected for processing (1)
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt

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.

@RXWatcher
RXWatcher merged commit b9c4fa2 into Silo-Server:main Aug 6, 2026
2 checks passed
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