aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2021-08-17 22:05:19 -0400
committerAjay Ramachandran <[email protected]>2021-08-17 22:05:19 -0400
commit8b348a2aeba501a003da4544d091040246e60a51 (patch)
tree3e162dd634746ac700d4e3e9d1be77e01965ad8c /src
parent28096e1ba669f980b77684bcccef22755d59420d (diff)
downloadSponsorBlock-8b348a2aeba501a003da4544d091040246e60a51.tar.gz
SponsorBlock-8b348a2aeba501a003da4544d091040246e60a51.zip
Rename highlight category to poi_highlight
Diffstat (limited to 'src')
-rw-r--r--src/config.ts12
-rw-r--r--src/utils.ts9
2 files changed, 10 insertions, 11 deletions
diff --git a/src/config.ts b/src/config.ts
index 5e25f774..f71b3b9f 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -60,8 +60,8 @@ interface SBConfig {
"preview-preview": PreviewBarOption,
"music_offtopic": PreviewBarOption,
"preview-music_offtopic": PreviewBarOption,
- "highlight": PreviewBarOption,
- "preview-highlight": PreviewBarOption,
+ "poi_highlight": PreviewBarOption,
+ "preview-poi_highlight": PreviewBarOption,
}
}
@@ -249,11 +249,11 @@ const Config: SBObject = {
color: "#a6634a",
opacity: "0.7"
},
- "highlight": {
+ "poi_highlight": {
color: "#ff1684",
opacity: "0.7"
},
- "preview-highlight": {
+ "preview-poi_highlight": {
color: "#9b044c",
opacity: "0.7"
}
@@ -352,11 +352,11 @@ function fetchConfig(): Promise<void> {
}
function migrateOldFormats(config: SBConfig) {
- if (!config["highlightCategoryAdded"] && !config.categorySelections.some((s) => s.name === "highlight")) {
+ if (!config["highlightCategoryAdded"] && !config.categorySelections.some((s) => s.name === "poi_highlight")) {
config["highlightCategoryAdded"] = true;
config.categorySelections.push({
- name: "highlight" as Category,
+ name: "poi_highlight" as Category,
option: CategorySkipOption.ManualSkip
});
diff --git a/src/utils.ts b/src/utils.ts
index 29a8ef38..b2c75cd8 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -44,11 +44,10 @@ export default class Utils {
}
getCategoryActionType(category: Category): CategoryActionType {
- switch (category) {
- case "highlight":
- return CategoryActionType.POI;
- default:
- return CategoryActionType.Skippable;
+ if (category.startsWith("poi_")) {
+ return CategoryActionType.POI;
+ } else {
+ return CategoryActionType.Skippable;
}
}