Files
SubMiner/src/main/runtime/mpv-jellyfin-defaults.ts
T
sudacode 6ba91780c1 feat(config): unify mpv plugin options under main config and add CSS/Ani
- Replace subminer.conf plugin config with mpv.* fields in config.jsonc
- Add socketPath, backend, autoStartSubMiner, pauseUntilOverlayReady, aniskipEnabled/buttonKey, subminerBinaryPath to mpv config
- Add subtitleSidebar.css field; migrate legacy sidebar appearance fields
- Add paintOrder and WebkitTextStroke to subtitle style options
- Update default subtitle/sidebar fontFamily to CJK-first stack
- Fix overlay visible state surviving mpv y-r restart
- Fix live config saves applying subtitle CSS immediately to open overlays
- Migrate legacy primary/secondary subtitle appearance into subtitleStyle.css on load
- Switch AniSkip button key setting to click-to-learn key capture
2026-05-18 03:07:39 -07:00

24 lines
1.1 KiB
TypeScript

import type { MpvRuntimeClientLike } from '../../core/services/mpv';
import { getDefaultMpvSocketPath } from '../../shared/mpv-socket-path';
export function createApplyJellyfinMpvDefaultsHandler(deps: {
sendMpvCommandRuntime: (client: MpvRuntimeClientLike, command: [string, string, string]) => void;
jellyfinLangPref: string;
}) {
return (client: MpvRuntimeClientLike): void => {
deps.sendMpvCommandRuntime(client, ['set_property', 'sub-auto', 'fuzzy']);
deps.sendMpvCommandRuntime(client, ['set_property', 'aid', 'auto']);
deps.sendMpvCommandRuntime(client, ['set_property', 'sid', 'auto']);
deps.sendMpvCommandRuntime(client, ['set_property', 'secondary-sid', 'auto']);
deps.sendMpvCommandRuntime(client, ['set_property', 'secondary-sub-visibility', 'no']);
deps.sendMpvCommandRuntime(client, ['set_property', 'alang', deps.jellyfinLangPref]);
deps.sendMpvCommandRuntime(client, ['set_property', 'slang', deps.jellyfinLangPref]);
};
}
export function createGetDefaultSocketPathHandler(deps: { platform: string }) {
return (): string => {
return getDefaultMpvSocketPath(deps.platform as NodeJS.Platform);
};
}