Files
SubMiner/src/shared/mpv-launch-mode.ts
sudacode de4f3efa30 docs: add mpv.launchMode to config docs, add changelog:docs generator, format
- Document the new mpv.launchMode option in the configuration docs page
- Add changelog:docs command to auto-generate docs-site/changelog.md from root CHANGELOG.md
- Add breaking changes support to the changelog fragment generator
- Fix docs-sync test to only compare current minor release headings
- Apply prettier formatting to source files
2026-04-07 01:06:43 -07:00

28 lines
714 B
TypeScript

import type { MpvLaunchMode } from '../types/config';
export const MPV_LAUNCH_MODE_VALUES = [
'normal',
'maximized',
'fullscreen',
] as const satisfies readonly MpvLaunchMode[];
export function parseMpvLaunchMode(value: unknown): MpvLaunchMode | undefined {
if (typeof value !== 'string') {
return undefined;
}
const normalized = value.trim().toLowerCase();
return MPV_LAUNCH_MODE_VALUES.find((candidate) => candidate === normalized);
}
export function buildMpvLaunchModeArgs(launchMode: MpvLaunchMode): string[] {
switch (launchMode) {
case 'fullscreen':
return ['--fullscreen'];
case 'maximized':
return ['--window-maximized=yes'];
default:
return [];
}
}