Skip to content

Commit 6e394cd

Browse files
committed
web/settings: add youtubeVideoContainer & subtitleLang
& bump schema to v6
1 parent 3daf1c4 commit 6e394cd

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

web/src/lib/settings/defaults.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defaultLocale } from "$lib/i18n/translations";
33
import type { CobaltSettings } from "$lib/types/settings";
44

55
const defaultSettings: CobaltSettings = {
6-
schemaVersion: 5,
6+
schemaVersion: 6,
77
advanced: {
88
debug: false,
99
useWebCodecs: false,
@@ -33,7 +33,9 @@ const defaultSettings: CobaltSettings = {
3333
tiktokFullAudio: false,
3434
convertGif: true,
3535
videoQuality: "1080",
36+
subtitleLang: "none",
3637
youtubeVideoCodec: "h264",
38+
youtubeVideoContainer: "auto",
3739
youtubeDubLang: "original",
3840
youtubeHLS: false,
3941
youtubeBetterAudio: false,

web/src/lib/types/settings.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ import type { CobaltSettingsV2 } from "$lib/types/settings/v2";
33
import type { CobaltSettingsV3 } from "$lib/types/settings/v3";
44
import type { CobaltSettingsV4 } from "$lib/types/settings/v4";
55
import type { CobaltSettingsV5 } from "$lib/types/settings/v5";
6+
import type { CobaltSettingsV6 } from "$lib/types/settings/v6";
67

78
export * from "$lib/types/settings/v2";
89
export * from "$lib/types/settings/v3";
910
export * from "$lib/types/settings/v4";
1011
export * from "$lib/types/settings/v5";
12+
export * from "$lib/types/settings/v6";
1113

12-
export type CobaltSettings = CobaltSettingsV5;
14+
export type CobaltSettings = CobaltSettingsV6;
1315

14-
export type AnyCobaltSettings = CobaltSettingsV4 | CobaltSettingsV3 | CobaltSettingsV2 | CobaltSettings;
16+
export type AnyCobaltSettings = CobaltSettingsV5 | CobaltSettingsV4 | CobaltSettingsV3 | CobaltSettingsV2 | CobaltSettings;
1517

1618
export type PartialSettings = RecursivePartial<CobaltSettings>;
1719

web/src/lib/types/settings/v6.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { SubtitleLang } from "$lib/settings/audio-sub-language";
2+
import type { CobaltSettingsV5 } from "$lib/types/settings/v5";
3+
4+
export const youtubeVideoContainerOptions = ["auto", "mp4", "webm", "mkv"] as const;
5+
6+
export type CobaltSettingsV6 = Omit<CobaltSettingsV5, 'schemaVersion' | 'save'> & {
7+
schemaVersion: 6,
8+
save: CobaltSettingsV5['save'] & {
9+
youtubeVideoContainer: typeof youtubeVideoContainerOptions[number];
10+
subtitleLang: SubtitleLang,
11+
},
12+
};

0 commit comments

Comments
 (0)