Enable preview category by default for people with intermission enabled

This commit is contained in:
Ajay Ramachandran
2021-06-18 01:26:16 -04:00
parent a12ef41060
commit b4e269bce6

View File

@@ -337,6 +337,25 @@ function fetchConfig(): Promise<void> {
}
function migrateOldFormats(config: SBConfig) {
// Adding preview category
if (!config["previewCategoryUpdate"]) {
config["previewCategoryUpdate"] = true;
for (const selection of config.categorySelections) {
if (selection.name === "intro"
&& selection.option === CategorySkipOption.AutoSkip || selection.option === CategorySkipOption.ManualSkip) {
// Add a default skip option for preview category
config.categorySelections.push({
name: "preview",
option: CategorySkipOption.ManualSkip
});
// Ensure it gets updated
config.categorySelections = config.categorySelections;
break;
}
}
}
if (config["disableAutoSkip"]) {
for (const selection of config.categorySelections) {
if (selection.name === "sponsor") {