mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-01 18:22:41 -08:00
fix(overlay): honor mpv subtitle binding config and tidy modal close
This commit is contained in:
@@ -135,6 +135,20 @@ test('dispatchMpvProtocolMessage enforces sub-visibility hidden when overlay sup
|
||||
});
|
||||
});
|
||||
|
||||
test('dispatchMpvProtocolMessage skips sub-visibility suppression when overlay binding is disabled', async () => {
|
||||
const { deps, state } = createDeps({
|
||||
shouldBindVisibleOverlayToMpvSubVisibility: () => false,
|
||||
isVisibleOverlayVisible: () => true,
|
||||
});
|
||||
|
||||
await dispatchMpvProtocolMessage(
|
||||
{ event: 'property-change', name: 'sub-visibility', data: 'yes' },
|
||||
deps,
|
||||
);
|
||||
|
||||
assert.equal(state.commands.length, 0);
|
||||
});
|
||||
|
||||
test('dispatchMpvProtocolMessage sets secondary subtitle track based on track list response', async () => {
|
||||
const { deps, state } = createDeps();
|
||||
|
||||
|
||||
@@ -220,7 +220,8 @@ export async function dispatchMpvProtocolMessage(
|
||||
} else if (msg.name === 'sub-visibility') {
|
||||
if (
|
||||
deps.isVisibleOverlayVisible() &&
|
||||
asBoolean(msg.data, false)
|
||||
asBoolean(msg.data, false) &&
|
||||
(deps.shouldBindVisibleOverlayToMpvSubVisibility?.() ?? true)
|
||||
) {
|
||||
deps.sendCommand({ command: ['set_property', 'sub-visibility', 'no'] });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user