aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/content.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/content.ts')
-rw-r--r--src/content.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/content.ts b/src/content.ts
index 07bf607c..2b719591 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -687,7 +687,7 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
const hashPrefix = (await utils.getHash(id, 1)).substr(0, 4);
const response = await utils.asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
categories,
- actionTypes: Config.config.muteSegments ? [ActionType.Skip, ActionType.Mute, ActionType.Full] : [ActionType.Skip, ActionType.Full],
+ actionTypes: getEnabledActionTypes(),
userAgent: `${chrome.runtime.id}`,
...extraRequestData
});
@@ -768,6 +768,18 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
lookupVipInformation(id);
}
+function getEnabledActionTypes(): ActionType[] {
+ const actionTypes = [ActionType.Skip];
+ if (Config.config.muteSegments) {
+ actionTypes.push(ActionType.Mute);
+ }
+ if (Config.config.fullVideoSegments) {
+ actionTypes.push(ActionType.Full);
+ }
+
+ return actionTypes;
+}
+
function lookupVipInformation(id: string): void {
updateVipInfo().then((isVip) => {
if (isVip) {