Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into improvements

This commit is contained in:
Ajay Ramachandran
2021-08-17 18:25:18 -04:00
28 changed files with 783 additions and 83 deletions

View File

@@ -38,6 +38,7 @@ interface SBConfig {
ytInfoPermissionGranted: boolean,
allowExpirements: boolean,
autoHideInfoButton: boolean,
autoSkipOnMusicVideos: boolean,
// What categories should be skipped
categorySelections: CategorySelection[],
@@ -179,6 +180,7 @@ const Config: SBObject = {
ytInfoPermissionGranted: false,
allowExpirements: true,
autoHideInfoButton: true,
autoSkipOnMusicVideos: false,
categorySelections: [{
name: "sponsor" as Category,
@@ -365,6 +367,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;