feat(subtitles): add no-jump subtitle-delay shift commands

This commit is contained in:
2026-03-02 01:12:26 -08:00
parent 3c66ea6b30
commit 11e9c721c6
17 changed files with 487 additions and 3 deletions

View File

@@ -11,6 +11,9 @@ test('ipc mpv command main deps builder maps callbacks', () => {
showMpvOsd: (text) => calls.push(`osd:${text}`),
replayCurrentSubtitle: () => calls.push('replay'),
playNextSubtitle: () => calls.push('next'),
shiftSubDelayToAdjacentSubtitle: async (direction) => {
calls.push(`shift:${direction}`);
},
sendMpvCommand: (command) => calls.push(`cmd:${command.join(':')}`),
isMpvConnected: () => true,
hasRuntimeOptionsManager: () => false,
@@ -22,6 +25,7 @@ test('ipc mpv command main deps builder maps callbacks', () => {
deps.showMpvOsd('hello');
deps.replayCurrentSubtitle();
deps.playNextSubtitle();
void deps.shiftSubDelayToAdjacentSubtitle('next');
deps.sendMpvCommand(['show-text', 'ok']);
assert.equal(deps.isMpvConnected(), true);
assert.equal(deps.hasRuntimeOptionsManager(), false);
@@ -31,6 +35,7 @@ test('ipc mpv command main deps builder maps callbacks', () => {
'osd:hello',
'replay',
'next',
'shift:next',
'cmd:show-text:ok',
]);
});