refactor: move youtube primary subtitle config to youtube

This commit is contained in:
2026-03-25 23:53:56 -07:00
parent 61d15f9431
commit 242402b253
16 changed files with 66 additions and 44 deletions

View File

@@ -11,6 +11,7 @@ export const CORE_DEFAULT_CONFIG: Pick<
| 'controller'
| 'shortcuts'
| 'secondarySub'
| 'youtube'
| 'subsync'
| 'startupWarmups'
| 'auto_start_overlay'
@@ -93,6 +94,9 @@ export const CORE_DEFAULT_CONFIG: Pick<
autoLoadSecondarySub: false,
defaultMode: 'hover',
},
youtube: {
primarySubLanguages: ['ja', 'jpn'],
},
subsync: {
defaultMode: 'auto',
alass_path: '',

View File

@@ -152,6 +152,5 @@ export const INTEGRATIONS_DEFAULT_CONFIG: Pick<
model: '',
systemPrompt: '',
},
primarySubLanguages: ['ja', 'jpn'],
},
};

View File

@@ -22,6 +22,7 @@ test('config option registry includes critical paths and has unique entries', ()
'controller.enabled',
'controller.scrollPixelsPerSecond',
'startupWarmups.lowPowerMode',
'youtube.primarySubLanguages',
'subtitleStyle.enableJlpt',
'subtitleStyle.autoPauseVideoOnYomitanPopup',
'ankiConnect.enabled',
@@ -43,6 +44,7 @@ test('config template sections include expected domains and unique keys', () =>
'annotationWebsocket',
'controller',
'startupWarmups',
'youtube',
'subtitleStyle',
'ankiConnect',
'yomitan',

View File

@@ -83,6 +83,12 @@ export function buildCoreConfigOptionRegistry(
defaultValue: defaultConfig.logging.level,
description: 'Minimum log level for runtime logging.',
},
{
path: 'youtube.primarySubLanguages',
kind: 'string',
defaultValue: defaultConfig.youtube.primarySubLanguages.join(','),
description: 'Comma-separated primary subtitle language priority for YouTube auto-loading.',
},
{
path: 'controller.enabled',
kind: 'boolean',

View File

@@ -411,11 +411,5 @@ export function buildIntegrationConfigOptionRegistry(
description:
'Optional system prompt override for legacy subtitle fallback post-processing; not used by default.',
},
{
path: 'youtubeSubgen.primarySubLanguages',
kind: 'string',
defaultValue: defaultConfig.youtubeSubgen.primarySubLanguages.join(','),
description: 'Comma-separated primary subtitle language priority used by the launcher.',
},
];
}

View File

@@ -132,7 +132,7 @@ const INTEGRATION_TEMPLATE_SECTIONS: ConfigTemplateSection[] = [
{
title: 'YouTube Playback Settings',
description: ['Defaults for SubMiner YouTube subtitle loading and languages.'],
key: 'youtubeSubgen',
key: 'youtube',
},
{
title: 'Anilist',