web/settings: validate youtubeDubLang as literal
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Run service tests / test service functionality (push) Has been cancelled
Run service tests / test service: ${{ matrix.service }} (push) Has been cancelled

This commit is contained in:
jj 2024-11-03 20:02:43 +00:00
parent 160160704d
commit f4ca4ea719
No known key found for this signature in database

View file

@ -9,6 +9,7 @@ import {
youtubeVideoCodecOptions,
type PartialSettings,
} from '$lib/types/settings';
import { youtubeLanguages } from './youtube-lang';
function validateTypes(input: unknown, reference = defaultSettings as unknown) {
if (typeof input === 'undefined')
@ -79,7 +80,8 @@ export function validateSettings(settings: PartialSettings) {
[ settings?.save?.filenameStyle , filenameStyleOptions ],
[ settings?.save?.videoQuality , videoQualityOptions ],
[ settings?.save?.youtubeVideoCodec, youtubeVideoCodecOptions ],
[ settings?.save?.savingMethod , savingMethodOptions ]
[ settings?.save?.savingMethod , savingMethodOptions ],
[ settings?.save?.youtubeDubLang , youtubeLanguages ]
])
);
}