Reset subtitle delay when the new track has none saved #73
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fm/sub-offset-reset"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Change
Reset the enabled subtitle track's delay to zero when it has no saved track modification. Direct-play track switches previously copied the old track's delay and only replaced it when the new track had a saved row.
One standalone, upstream-path-only commit:
Reset subtitle delay when the new track has none saved. Add a regression using the existing MockK/Robolectric harness: start on track A with 2 seconds saved, then switch to track B with no saved delay, track B with a saved -750 ms delay, or subtitles disabled. The test also guards against falling back to media-item reload. No database, proto, renderer, player-gate, or Wolfskin-specific changes.Verification
0sbut retained2s.PlaybackViewModelTestspass, including all three subtitle-switch cases.bash docker/gradle.sh debug :app:testDefaultDebugUnitTest --tests 'com.github.damontecres.wholphin.ui.playback.PlaybackViewModelTests' -x :wolfskin-design:testDebugUnitTest. The exclusion avoids the unrelated design suite inherited by app Test tasks.PlaybackViewModel.kt:838:102, reproduced against the committed baseline and left unchanged.Scope and risk
This is only subtitle-delay persistence/reset commit 3, independent of the renderer/control work. Disabled subtitles retain the inactive delay without loading a disabled-track row. Validation exercises view-model switching with mocked player/network/persistence boundaries; no APK, emulator, ADB, or TV-box check. Burned-in subtitle support, positive-delay seek behavior and paused libass repaint are outside this change.
AI-assisted implementation; this PR is on the private fork only, not the upstream repository.
Review of the subtitle delay reset slice at head
8da699ca8baa41d14741e6824ba183214a792bec(basefm/tv-round2).Code verdict: APPROVE (
review/code-claude= success).Design verdict: PASS (
review/design-claude= success). No UI file, string or token is touched.Resets where the plan says.
result?.delayMs?.milliseconds ?: Duration.ZERO. The diff does exactly that, still insidesubtitleIndexEnabled.loadSubtitleDelayruns after a direct-play in-place switch, which is the buggy path, and after a media-item prepare. After a prepare the playback state is rebuilt with delay zero, so the reset changes nothing there.Persistence unchanged.
MPV.
currentPlayback.subtitleDelay.Test.
PlaybackViewModelTestscase starts with track A at 2 s saved and switches bychangeSubtitleStream. B with no row gives zero, B with -750 ms gives -750 ms, and DISABLED keeps 2 s.setMediaItemcount guards against a reload fallback, and acoVerify(exactly = 0)guards the disabled lookup.expected:<0s> but was:<2s>) and passes after (19 tests). I did not re-run it.Merge and scope. A merge-tree check against current
fm/tv-round2is clean. It is a standalone commit with no Wolfskin-specific change.Non-blocking notes:
Full report (review 11):
/root/.treehouse/firstmate-7bab20/2/firstmate/data/round2-review/report.md. Not run: Gradle/make, nothing on the box.