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

@@ -29,6 +29,8 @@ test('parseLauncherYoutubeSubgenConfig keeps only valid typed values', () => {
model: 'openrouter/subgen-model',
systemPrompt: 'Fix subtitles only.',
},
},
youtube: {
primarySubLanguages: ['ja', 42, 'en'],
},
secondarySub: {

View File

@@ -14,6 +14,9 @@ export function parseLauncherYoutubeSubgenConfig(
youtubeSubgenRaw && typeof youtubeSubgenRaw === 'object'
? (youtubeSubgenRaw as Record<string, unknown>)
: null;
const youtubeRaw = root.youtube;
const youtube =
youtubeRaw && typeof youtubeRaw === 'object' ? (youtubeRaw as Record<string, unknown>) : null;
const secondarySubRaw = root.secondarySub;
const secondarySub =
secondarySubRaw && typeof secondarySubRaw === 'object'
@@ -74,7 +77,7 @@ export function parseLauncherYoutubeSubgenConfig(
}
: undefined,
),
primarySubLanguages: asStringArray(youtubeSubgen?.primarySubLanguages),
primarySubLanguages: asStringArray(youtube?.primarySubLanguages),
secondarySubLanguages: asStringArray(secondarySub?.secondarySubLanguages),
jimakuApiKey: typeof jimaku?.apiKey === 'string' ? jimaku.apiKey : undefined,
jimakuApiKeyCommand: