From 3c1d3f5d8e4b525de71e43dd90da96d653613d51 Mon Sep 17 00:00:00 2001 From: Ajay Date: Wed, 23 Apr 2025 20:55:06 -0400 Subject: [PATCH] Fix cases where hidden segments are not skipped when a chapter is at the same time Fixes #2228 --- src/content.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index 2b9588b1..26ef7f66 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1499,7 +1499,10 @@ function getNextSkipIndex(currentTime: number, includeIntersectingSegments: bool const autoSkipSorter = (segment: ScheduledTime) => { const skipOption = utils.getCategorySelection(segment.category)?.option; - if ((skipOption === CategorySkipOption.AutoSkip || shouldAutoSkip(segment)) + if (segment.hidden !== SponsorHideType.Visible) { + // Hidden segments sometimes end up here if another segment is at the same time, use them last + return 3; + } else if ((skipOption === CategorySkipOption.AutoSkip || shouldAutoSkip(segment)) && segment.actionType === ActionType.Skip) { return 0; } else if (skipOption !== CategorySkipOption.ShowOverlay) {