web/settings: validate youtubeDubLang as literal

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 ]
])
);
}