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

This commit is contained in:
Ajay
2021-12-25 22:14:34 -05:00
37 changed files with 397 additions and 186 deletions

View File

@@ -45,13 +45,13 @@ interface SBConfig {
showDonationLink: boolean,
autoHideInfoButton: boolean,
autoSkipOnMusicVideos: boolean,
highlightCategoryUpdate: boolean,
colorPalette: {
red: string,
white: string,
locked: string
},
scrollToEditTimeUpdate: boolean,
fillerUpdate: boolean,
// What categories should be skipped
categorySelections: CategorySelection[],
@@ -75,6 +75,8 @@ interface SBConfig {
"preview-music_offtopic": PreviewBarOption,
"poi_highlight": PreviewBarOption,
"preview-poi_highlight": PreviewBarOption,
"filler": PreviewBarOption,
"preview-filler": PreviewBarOption,
}
}
@@ -200,12 +202,15 @@ const Config: SBObject = {
showDonationLink: true,
autoHideInfoButton: true,
autoSkipOnMusicVideos: false,
highlightCategoryUpdate: false, // TODO: Remove this once update is done
scrollToEditTimeUpdate: false, // false means the tooltip will be shown
fillerUpdate: false,
categorySelections: [{
name: "sponsor" as Category,
option: CategorySkipOption.AutoSkip
}, {
name: "poi_highlight" as Category,
option: CategorySkipOption.ManualSkip
}],
colorPalette: {
@@ -283,6 +288,14 @@ const Config: SBObject = {
"preview-poi_highlight": {
color: "#9b044c",
opacity: "0.7"
},
"filler": {
color: "#7300FF",
opacity: "0.9"
},
"preview-filler": {
color: "#2E0066",
opacity: "0.7"
}
}
},
@@ -379,16 +392,11 @@ function fetchConfig(): Promise<void> {
}
function migrateOldFormats(config: SBConfig) {
// Should eventually move into defaults
if (!config["highlightCategoryAdded"] && !config.categorySelections.some((s) => s.name === "poi_highlight")) {
config["highlightCategoryAdded"] = true;
config.categorySelections.push({
name: "poi_highlight" as Category,
option: CategorySkipOption.ManualSkip
});
config.categorySelections = config.categorySelections;
if (config["highlightCategoryAdded"] !== undefined) {
chrome.storage.sync.remove("highlightCategoryAdded");
}
if (config["highlightCategoryUpdate"] !== undefined) {
chrome.storage.sync.remove("highlightCategoryUpdate");
}
if (config["askAboutUnlistedVideos"]) {