mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 20:17:05 +03:00
Add video title as option for advanced skip settings
This commit is contained in:
Submodule maze-utils updated: e3388197c3...33f0b5b757
@@ -1,3 +1,4 @@
|
|||||||
|
import { getCurrentPageTitle } from "../../maze-utils/src/elements";
|
||||||
import { getChannelIDInfo, getVideoDuration } from "../../maze-utils/src/video";
|
import { getChannelIDInfo, getVideoDuration } from "../../maze-utils/src/video";
|
||||||
import Config from "../config";
|
import Config from "../config";
|
||||||
import { CategorySelection, CategorySkipOption, SponsorSourceType, SponsorTime } from "../types";
|
import { CategorySelection, CategorySkipOption, SponsorSourceType, SponsorTime } from "../types";
|
||||||
@@ -20,7 +21,8 @@ export enum SkipRuleAttribute {
|
|||||||
Source = "chapter.source",
|
Source = "chapter.source",
|
||||||
ChannelID = "channel.id",
|
ChannelID = "channel.id",
|
||||||
ChannelName = "channel.name",
|
ChannelName = "channel.name",
|
||||||
VideoDuration = "video.duration"
|
VideoDuration = "video.duration",
|
||||||
|
Title = "video.title"
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum SkipRuleOperator {
|
export enum SkipRuleOperator {
|
||||||
@@ -119,6 +121,8 @@ function getSkipRuleValue(segment: SponsorTime | VideoLabelsCacheData, rule: Adv
|
|||||||
return getChannelIDInfo().author;
|
return getChannelIDInfo().author;
|
||||||
case SkipRuleAttribute.VideoDuration:
|
case SkipRuleAttribute.VideoDuration:
|
||||||
return getVideoDuration();
|
return getVideoDuration();
|
||||||
|
case SkipRuleAttribute.Title:
|
||||||
|
return getCurrentPageTitle() || "";
|
||||||
default:
|
default:
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user