mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-05 19:21:35 -07:00
feat(subsync): add reference and target subtitle track picker (#181)
This commit is contained in:
@@ -326,7 +326,13 @@ test('handleOverlayModalClosed hides modal window only after all pending modals
|
||||
});
|
||||
runtime.sendToActiveOverlayWindow(
|
||||
'subsync:open-manual',
|
||||
{ ffsubsyncAvailable: true, sourceTracks: [] },
|
||||
{
|
||||
ffsubsyncAvailable: true,
|
||||
videoReferenceAvailable: true,
|
||||
subtitleTracks: [],
|
||||
defaultReferenceTrackId: null,
|
||||
defaultTargetTrackId: null,
|
||||
},
|
||||
{
|
||||
restoreOnModalClose: 'subsync',
|
||||
},
|
||||
@@ -560,7 +566,13 @@ test('modal runtime notifies callers when modal input state becomes active/inact
|
||||
});
|
||||
runtime.sendToActiveOverlayWindow(
|
||||
'subsync:open-manual',
|
||||
{ ffsubsyncAvailable: true, sourceTracks: [] },
|
||||
{
|
||||
ffsubsyncAvailable: true,
|
||||
videoReferenceAvailable: true,
|
||||
subtitleTracks: [],
|
||||
defaultReferenceTrackId: null,
|
||||
defaultTargetTrackId: null,
|
||||
},
|
||||
{
|
||||
restoreOnModalClose: 'subsync',
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ import { composeIpcRuntimeHandlers } from './ipc-runtime-composer';
|
||||
|
||||
test('composeIpcRuntimeHandlers returns callable IPC handlers and registration bridge', async () => {
|
||||
let registered = false;
|
||||
let receivedSourceTrackId: number | null | undefined;
|
||||
let receivedReferenceTrackId: number | null | undefined;
|
||||
|
||||
const composed = composeIpcRuntimeHandlers({
|
||||
mpvCommandMainDeps: {
|
||||
@@ -25,7 +25,7 @@ test('composeIpcRuntimeHandlers returns callable IPC handlers and registration b
|
||||
},
|
||||
handleMpvCommandFromIpcRuntime: () => {},
|
||||
runSubsyncManualFromIpc: async (request) => {
|
||||
receivedSourceTrackId = request.sourceTrackId;
|
||||
receivedReferenceTrackId = request.referenceTrackId;
|
||||
return {
|
||||
ok: true,
|
||||
message: 'ok',
|
||||
@@ -124,10 +124,10 @@ test('composeIpcRuntimeHandlers returns callable IPC handlers and registration b
|
||||
|
||||
const result = await composed.runSubsyncManualFromIpc({
|
||||
engine: 'alass',
|
||||
sourceTrackId: 7,
|
||||
referenceTrackId: 7,
|
||||
});
|
||||
assert.deepEqual(result, { ok: true, message: 'ok' });
|
||||
assert.equal(receivedSourceTrackId, 7);
|
||||
assert.equal(receivedReferenceTrackId, 7);
|
||||
|
||||
composed.registerIpcRuntimeHandlers();
|
||||
assert.equal(registered, true);
|
||||
|
||||
@@ -11,7 +11,7 @@ import { createOverlayNotificationDelivery } from './overlay-notification-delive
|
||||
test('notifyConfiguredStatus routes both to overlay and system without osd', () => {
|
||||
const calls: string[] = [];
|
||||
|
||||
notifyConfiguredStatus('Subsync: choose engine and source', {
|
||||
notifyConfiguredStatus('Subsync: choose engine and subtitles', {
|
||||
getNotificationType: () => 'both',
|
||||
showOsd: (message) => {
|
||||
calls.push(`osd:${message}`);
|
||||
@@ -25,8 +25,8 @@ test('notifyConfiguredStatus routes both to overlay and system without osd', ()
|
||||
});
|
||||
|
||||
assert.deepEqual(calls, [
|
||||
'overlay::SubMiner:Subsync: choose engine and source:info:auto',
|
||||
'desktop:SubMiner:Subsync: choose engine and source',
|
||||
'overlay::SubMiner:Subsync: choose engine and subtitles:info:auto',
|
||||
'desktop:SubMiner:Subsync: choose engine and subtitles',
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -5,7 +5,13 @@ import type { SubsyncManualPayload } from '../../types';
|
||||
|
||||
const payload: SubsyncManualPayload = {
|
||||
ffsubsyncAvailable: true,
|
||||
sourceTracks: [{ id: 2, label: 'External #2 - eng' }],
|
||||
videoReferenceAvailable: true,
|
||||
subtitleTracks: [
|
||||
{ id: 1, label: 'Internal #1 - jpn (active)' },
|
||||
{ id: 2, label: 'External #2 - eng' },
|
||||
],
|
||||
defaultReferenceTrackId: 2,
|
||||
defaultTargetTrackId: 1,
|
||||
};
|
||||
|
||||
test('subsync manual open prefers dedicated modal window on first attempt', async () => {
|
||||
|
||||
Reference in New Issue
Block a user