Fix segments appearing in chapter bar even when category disabled

Fixes #2292
This commit is contained in:
Ajay
2025-06-25 02:25:07 -04:00
parent fa7b9eee01
commit 17c49ace63

View File

@@ -5,7 +5,7 @@ https://github.com/videosegments/videosegments/commits/f1e111bdfe231947800c6efdd
import Config from "../config";
import { ChapterVote } from "../render/ChapterVote";
import { ActionType, Category, SegmentContainer, SponsorHideType, SponsorSourceType, SponsorTime } from "../types";
import { ActionType, Category, CategorySkipOption, SegmentContainer, SponsorHideType, SponsorSourceType, SponsorTime } from "../types";
import { partition } from "../utils/arrayUtils";
import { DEFAULT_CATEGORY, shortCategoryName } from "../utils/categoryUtils";
import { normalizeChapterName } from "../utils/exporter";
@@ -14,6 +14,7 @@ import { addCleanupListener } from "../../maze-utils/src/cleanup";
import { hasAutogeneratedChapters, isVisible } from "../utils/pageUtils";
import { isVorapisInstalled } from "../utils/compatibility";
import { isOnYTTV } from "../../maze-utils/src/video";
import { getCategorySelection } from "../utils/skipRule";
const TOOLTIP_VISIBLE_CLASS = 'sponsorCategoryTooltipVisible';
const MIN_CHAPTER_SIZE = 0.003;
@@ -894,7 +895,8 @@ class PreviewBar {
const activeSegments = segments.filter((segment) => {
return segment.hidden === SponsorHideType.Visible
&& segment.segment[0] <= currentTime && segment.segment[1] > currentTime
&& segment.category !== DEFAULT_CATEGORY;
&& segment.category !== DEFAULT_CATEGORY
&& getCategorySelection(segment).option !== CategorySkipOption.Disabled
});
this.setActiveSegments(activeSegments);