Add video title as option for advanced skip settings

This commit is contained in:
Ajay
2025-07-22 20:07:01 -04:00
parent fd459414aa
commit 21b7507a9e
2 changed files with 6 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import { getCurrentPageTitle } from "../../maze-utils/src/elements";
import { getChannelIDInfo, getVideoDuration } from "../../maze-utils/src/video";
import Config from "../config";
import { CategorySelection, CategorySkipOption, SponsorSourceType, SponsorTime } from "../types";
@@ -20,7 +21,8 @@ export enum SkipRuleAttribute {
Source = "chapter.source",
ChannelID = "channel.id",
ChannelName = "channel.name",
VideoDuration = "video.duration"
VideoDuration = "video.duration",
Title = "video.title"
}
export enum SkipRuleOperator {
@@ -119,6 +121,8 @@ function getSkipRuleValue(segment: SponsorTime | VideoLabelsCacheData, rule: Adv
return getChannelIDInfo().author;
case SkipRuleAttribute.VideoDuration:
return getVideoDuration();
case SkipRuleAttribute.Title:
return getCurrentPageTitle() || "";
default:
return undefined;
}