diff --git a/src/content.ts b/src/content.ts index 51b03886..c3a4f42b 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1085,7 +1085,8 @@ function updatePreviewBar(): void { actionType: segment.actionType, unsubmitted: false, showLarger: segment.actionType === ActionType.Poi, - description: segment.description + description: segment.description, + source: segment.source, }); }); } @@ -1097,7 +1098,8 @@ function updatePreviewBar(): void { actionType: segment.actionType, unsubmitted: true, showLarger: segment.actionType === ActionType.Poi, - description: segment.description + description: segment.description, + source: segment.source }); }); diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index 66ff5d56..85c0d2e2 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -6,7 +6,7 @@ https://github.com/videosegments/videosegments/commits/f1e111bdfe231947800c6efdd 'use strict'; import Config from "../config"; -import { ActionType, Category, SegmentContainer, SponsorTime } from "../types"; +import { ActionType, Category, SegmentContainer, SponsorSourceType, SponsorTime } from "../types"; import Utils from "../utils"; import { partition } from "../utils/arrayUtils"; import { GenericUtils } from "../utils/genericUtils"; @@ -22,6 +22,7 @@ export interface PreviewBarSegment { unsubmitted: boolean; showLarger: boolean; description: string; + source: SponsorSourceType; } interface ChapterGroup extends SegmentContainer { @@ -120,7 +121,9 @@ class PreviewBar { if (timeInSeconds === null) return; // Find the segment at that location, using the shortest if multiple found - const [normalSegments, chapterSegments] = partition(this.segments, (segment) => segment.actionType !== ActionType.Chapter) + const [normalSegments, chapterSegments] = + partition(this.segments.filter((s) => s.source !== SponsorSourceType.YouTube), + (segment) => segment.actionType !== ActionType.Chapter); const normalSegment = this.getSmallestSegment(timeInSeconds, normalSegments); const chapterSegment = this.getSmallestSegment(timeInSeconds, chapterSegments); @@ -128,7 +131,7 @@ class PreviewBar { this.categoryTooltipContainer.classList.remove(TOOLTIP_VISIBLE_CLASS); } else { this.categoryTooltipContainer.classList.add(TOOLTIP_VISIBLE_CLASS); - if (noYoutubeChapters && normalSegment !== null && chapterSegment !== null) { + if (normalSegment !== null && chapterSegment !== null) { this.categoryTooltipContainer.classList.add("sponsorTwoTooltips"); } else { this.categoryTooltipContainer.classList.remove("sponsorTwoTooltips");