mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-29 12:15:27 -07:00
fix(subtitles): navigate by sanitized cues across ASS animation
- Route subtitle navigation through parsed cue boundaries - Treat explicit short seeks as subtitle priming events
This commit is contained in:
@@ -358,6 +358,30 @@ test('time-pos handler forces Jellyfin progress when mpv position jumps', () =>
|
||||
]);
|
||||
});
|
||||
|
||||
test('time-pos handler treats an explicit short jump as a seek', () => {
|
||||
const updateKinds: string[] = [];
|
||||
let explicitSeekPending = false;
|
||||
const timeHandler = createHandleMpvTimePosChangeHandler({
|
||||
recordPlaybackPosition: () => {},
|
||||
reportJellyfinRemoteProgress: () => {},
|
||||
refreshDiscordPresence: () => {},
|
||||
maybeRunAnilistPostWatchUpdate: async () => {},
|
||||
consumeExplicitSeek: () => {
|
||||
const pending = explicitSeekPending;
|
||||
explicitSeekPending = false;
|
||||
return pending;
|
||||
},
|
||||
onTimePosUpdate: (_time, kind) => updateKinds.push(kind),
|
||||
});
|
||||
|
||||
timeHandler({ time: 10 });
|
||||
explicitSeekPending = true;
|
||||
timeHandler({ time: 11.5 });
|
||||
timeHandler({ time: 11.6 });
|
||||
|
||||
assert.deepEqual(updateKinds, ['initial', 'seek', 'playback']);
|
||||
});
|
||||
|
||||
test('time-pos handler passes fresh playback time to AniList post-watch', async () => {
|
||||
const watchedSeconds: unknown[] = [];
|
||||
const timeHandler = createHandleMpvTimePosChangeHandler({
|
||||
|
||||
Reference in New Issue
Block a user