Skip to content

Commit 21b7507

Browse files
committed
Add video title as option for advanced skip settings
1 parent fd45941 commit 21b7507

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

maze-utils

src/utils/skipRule.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { getCurrentPageTitle } from "../../maze-utils/src/elements";
12
import { getChannelIDInfo, getVideoDuration } from "../../maze-utils/src/video";
23
import Config from "../config";
34
import { CategorySelection, CategorySkipOption, SponsorSourceType, SponsorTime } from "../types";
@@ -20,7 +21,8 @@ export enum SkipRuleAttribute {
2021
Source = "chapter.source",
2122
ChannelID = "channel.id",
2223
ChannelName = "channel.name",
23-
VideoDuration = "video.duration"
24+
VideoDuration = "video.duration",
25+
Title = "video.title"
2426
}
2527

2628
export enum SkipRuleOperator {
@@ -119,6 +121,8 @@ function getSkipRuleValue(segment: SponsorTime | VideoLabelsCacheData, rule: Adv
119121
return getChannelIDInfo().author;
120122
case SkipRuleAttribute.VideoDuration:
121123
return getVideoDuration();
124+
case SkipRuleAttribute.Title:
125+
return getCurrentPageTitle() || "";
122126
default:
123127
return undefined;
124128
}

0 commit comments

Comments
 (0)