diff options
author | Ajay Ramachandran <[email protected]> | 2021-06-18 01:26:16 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2021-06-18 01:26:16 -0400 |
commit | b4e269bce63eaec8eb8c947d37d9c5bbf317bf02 (patch) | |
tree | d9cc34d60850968b6c08dfbfd09241bb593d39ef /src | |
parent | a12ef41060a1331c713cd11947bc5a39ded210cf (diff) | |
download | SponsorBlock-b4e269bce63eaec8eb8c947d37d9c5bbf317bf02.tar.gz SponsorBlock-b4e269bce63eaec8eb8c947d37d9c5bbf317bf02.zip |
Enable preview category by default for people with intermission enabled
Diffstat (limited to 'src')
-rw-r--r-- | src/config.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/config.ts b/src/config.ts index 192e6416..26ae96a5 100644 --- a/src/config.ts +++ b/src/config.ts @@ -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") { |