Add skipping all segments when a non music segment exists

This commit is contained in:
Ajay Ramachandran
2021-08-03 15:19:29 -04:00
parent afeba5f077
commit a56bba0612
4 changed files with 42 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ interface SBConfig {
ytInfoPermissionGranted: boolean,
allowExpirements: boolean,
autoHideInfoButton: boolean,
autoSkipOnMusicVideos: boolean,
// What categories should be skipped
categorySelections: CategorySelection[],
@@ -180,6 +181,7 @@ const Config: SBObject = {
ytInfoPermissionGranted: false,
allowExpirements: true,
autoHideInfoButton: true,
autoSkipOnMusicVideos: false,
categorySelections: [{
name: "sponsor",
@@ -347,6 +349,18 @@ function migrateOldFormats(config: SBConfig) {
chrome.storage.sync.remove("askAboutUnlistedVideos");
}
if (!config["autoSkipOnMusicVideosUpdate"]) {
config["autoSkipOnMusicVideosUpdate"] = true;
for (const selection of config.categorySelections) {
if (selection.name === "music_offtopic"
&& selection.option === CategorySkipOption.AutoSkip) {
config.autoSkipOnMusicVideos = true;
break;
}
}
}
// Adding preview category
if (!config["previewCategoryUpdate"]) {
config["previewCategoryUpdate"] = true;