mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Say muted instead of skipped for mute segments
This commit is contained in:
@@ -311,6 +311,9 @@
|
|||||||
"skip_category": {
|
"skip_category": {
|
||||||
"message": "Skip {0}?"
|
"message": "Skip {0}?"
|
||||||
},
|
},
|
||||||
|
"mute_category": {
|
||||||
|
"message": "Mute {0}?"
|
||||||
|
},
|
||||||
"skip_to_category": {
|
"skip_to_category": {
|
||||||
"message": "Skip to {0}?",
|
"message": "Skip to {0}?",
|
||||||
"description": "Used for skipping to things (Skip to Highlight)"
|
"description": "Used for skipping to things (Skip to Highlight)"
|
||||||
@@ -319,6 +322,10 @@
|
|||||||
"message": "{0} Skipped",
|
"message": "{0} Skipped",
|
||||||
"description": "Example: Sponsor Skipped"
|
"description": "Example: Sponsor Skipped"
|
||||||
},
|
},
|
||||||
|
"muted": {
|
||||||
|
"message": "{0} Muted",
|
||||||
|
"description": "Example: Sponsor Muted"
|
||||||
|
},
|
||||||
"skipped_to_category": {
|
"skipped_to_category": {
|
||||||
"message": "Skipped to {0}",
|
"message": "Skipped to {0}",
|
||||||
"description": "Used for skipping to things (Skipped to Highlight)"
|
"description": "Used for skipping to things (Skipped to Highlight)"
|
||||||
|
|||||||
@@ -1,15 +1,39 @@
|
|||||||
import { Category, CategoryActionType, SponsorTime } from "../types";
|
import { ActionType, Category, CategoryActionType, SponsorTime } from "../types";
|
||||||
|
|
||||||
export function getSkippingText(segments: SponsorTime[], autoSkip: boolean): string {
|
export function getSkippingText(segments: SponsorTime[], autoSkip: boolean): string {
|
||||||
const categoryName = chrome.i18n.getMessage(segments.length > 1 ? "multipleSegments"
|
const categoryName = chrome.i18n.getMessage(segments.length > 1 ? "multipleSegments"
|
||||||
: "category_" + segments[0].category + "_short") || chrome.i18n.getMessage("category_" + segments[0].category);
|
: "category_" + segments[0].category + "_short") || chrome.i18n.getMessage("category_" + segments[0].category);
|
||||||
if (autoSkip) {
|
if (autoSkip) {
|
||||||
const messageId = getCategoryActionType(segments[0].category) === CategoryActionType.Skippable
|
let messageId = "";
|
||||||
? "skipped" : "skipped_to_category";
|
if (getCategoryActionType(segments[0].category) === CategoryActionType.Skippable) {
|
||||||
|
switch (segments[0].actionType) {
|
||||||
|
case ActionType.Skip:
|
||||||
|
messageId = "skipped";
|
||||||
|
break;
|
||||||
|
case ActionType.Mute:
|
||||||
|
messageId = "muted";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
messageId = "skipped_to_category";
|
||||||
|
}
|
||||||
|
|
||||||
return chrome.i18n.getMessage(messageId).replace("{0}", categoryName);
|
return chrome.i18n.getMessage(messageId).replace("{0}", categoryName);
|
||||||
} else {
|
} else {
|
||||||
const messageId = getCategoryActionType(segments[0].category) === CategoryActionType.Skippable
|
let messageId = "";
|
||||||
? "skip_category" : "skip_to_category";
|
if (getCategoryActionType(segments[0].category) === CategoryActionType.Skippable) {
|
||||||
|
switch (segments[0].actionType) {
|
||||||
|
case ActionType.Skip:
|
||||||
|
messageId = "skip_category";
|
||||||
|
break;
|
||||||
|
case ActionType.Mute:
|
||||||
|
messageId = "mute_category";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
messageId = "skip_to_category";
|
||||||
|
}
|
||||||
|
|
||||||
return chrome.i18n.getMessage(messageId).replace("{0}", categoryName);
|
return chrome.i18n.getMessage(messageId).replace("{0}", categoryName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user