From 963fb5832134fc0ca564199b5afc7ce2e2758bcc Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 6 Apr 2020 00:45:28 -0400 Subject: [PATCH] Fixed endIndex not being used while skipping and made end index finding function recursive --- src/content.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index e40bd40f..5aa62c6d 100644 --- a/src/content.ts +++ b/src/content.ts @@ -485,7 +485,7 @@ function startSponsorSchedule(currentTime?: number): void { // TODO: Remove this bug catching if statement when the bug is found let currentVideoID = getYouTubeVideoID(document.URL); if (currentVideoID == sponsorVideoID) { - skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice); + skipToTime(video, skipInfo.endIndex, skipInfo.array, skipInfo.openNotice); // TODO: Know the autoSkip settings for ALL items being skipped if (utils.getCategorySelection(currentSkip.category)) { @@ -911,6 +911,11 @@ function getLatestEndTimeIndex(sponsorTimes: SponsorTime[], index: number, hideH } } + // Keep going if required + if (latestEndTimeIndex !== index) { + latestEndTimeIndex = getLatestEndTimeIndex(sponsorTimes, latestEndTimeIndex, hideHiddenSponsors); + } + return latestEndTimeIndex; }