Add channel id and name attribute for advanced skip options

This commit is contained in:
Ajay
2025-06-07 01:01:52 -04:00
parent ec1df44cbc
commit da1a535de7
4 changed files with 35 additions and 23 deletions

View File

@@ -2,11 +2,10 @@ import { DataCache } from "../../maze-utils/src/cache";
import { getHash, HashedValue } from "../../maze-utils/src/hash";
import Config, { } from "../config";
import * as CompileConfig from "../../config.json";
import { ActionType, ActionTypes, CategorySkipOption, SponsorSourceType, SponsorTime, VideoID } from "../types";
import { ActionType, ActionTypes, SponsorSourceType, SponsorTime, VideoID } from "../types";
import { getHashParams } from "./pageUtils";
import { asyncRequestToServer } from "./requests";
import { extensionUserAgent } from "../../maze-utils/src";
import { getCategorySelection } from "./skipRule";
const segmentDataCache = new DataCache<VideoID, SegmentResponse>(() => {
return {
@@ -66,8 +65,7 @@ async function fetchSegmentsForVideo(videoID: VideoID): Promise<SegmentResponse>
const receivedSegments: SponsorTime[] = JSON.parse(response.responseText)
?.filter((video) => video.videoID === videoID)
?.map((video) => video.segments)?.[0]
?.filter((segment) => enabledActionTypes.includes(segment.actionType)
&& getCategorySelection(segment).option !== CategorySkipOption.Disabled)
?.filter((segment) => enabledActionTypes.includes(segment.actionType))
?.map((segment) => ({
...segment,
source: SponsorSourceType.Server