mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 12:37:05 +03:00
Fixed endIndex not being used while skipping and made end index finding function recursive
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user