mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-27 18:12:05 -07:00
feat(core): add Electron runtime, services, and app composition
This commit is contained in:
32
src/main/runtime/mpv-jellyfin-defaults.test.ts
Normal file
32
src/main/runtime/mpv-jellyfin-defaults.test.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
createApplyJellyfinMpvDefaultsHandler,
|
||||
createGetDefaultSocketPathHandler,
|
||||
} from './mpv-jellyfin-defaults';
|
||||
|
||||
test('apply jellyfin mpv defaults sends expected property commands', () => {
|
||||
const calls: string[] = [];
|
||||
const applyDefaults = createApplyJellyfinMpvDefaultsHandler({
|
||||
sendMpvCommandRuntime: (_client, command) => calls.push(command.join(':')),
|
||||
jellyfinLangPref: 'ja,jp',
|
||||
});
|
||||
|
||||
applyDefaults({ connected: true, send: () => {} });
|
||||
assert.deepEqual(calls, [
|
||||
'set_property:sub-auto:fuzzy',
|
||||
'set_property:aid:auto',
|
||||
'set_property:sid:auto',
|
||||
'set_property:secondary-sid:auto',
|
||||
'set_property:secondary-sub-visibility:no',
|
||||
'set_property:alang:ja,jp',
|
||||
'set_property:slang:ja,jp',
|
||||
]);
|
||||
});
|
||||
|
||||
test('get default socket path returns platform specific value', () => {
|
||||
const getWindowsPath = createGetDefaultSocketPathHandler({ platform: 'win32' });
|
||||
const getUnixPath = createGetDefaultSocketPathHandler({ platform: 'darwin' });
|
||||
assert.equal(getWindowsPath(), '\\\\.\\pipe\\subminer-socket');
|
||||
assert.equal(getUnixPath(), '/tmp/subminer-socket');
|
||||
});
|
||||
Reference in New Issue
Block a user