Fix stackoverflow

This commit is contained in:
Ajay
2022-02-23 01:37:19 -05:00
parent 0513a36a9a
commit 4d5c9005ae

View File

@@ -509,22 +509,25 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
if (incorrectVideoCheck(videoID, currentSkip)) return; if (incorrectVideoCheck(videoID, currentSkip)) return;
forceVideoTime ||= video.currentTime; forceVideoTime ||= video.currentTime;
if ((shouldSkip(currentSkip) || sponsorTimesSubmitting?.some((segment) => segment.segment === currentSkip.segment)) if ((shouldSkip(currentSkip) || sponsorTimesSubmitting?.some((segment) => segment.segment === currentSkip.segment))) {
&& forceVideoTime >= skipTime[0] && forceVideoTime < skipTime[1]) { if (forceVideoTime >= skipTime[0] && forceVideoTime < skipTime[1]) {
skipToTime({ skipToTime({
v: video, v: video,
skipTime, skipTime,
skippingSegments, skippingSegments,
openNotice: skipInfo.openNotice openNotice: skipInfo.openNotice
}); });
if (utils.getCategorySelection(currentSkip.category)?.option === CategorySkipOption.ManualSkip if (utils.getCategorySelection(currentSkip.category)?.option === CategorySkipOption.ManualSkip
|| currentSkip.actionType === ActionType.Mute) { || currentSkip.actionType === ActionType.Mute) {
forcedSkipTime = skipTime[0] + 0.001; forcedSkipTime = skipTime[0] + 0.001;
} else {
forcedSkipTime = skipTime[1];
forcedIncludeIntersectingSegments = true;
forcedIncludeNonIntersectingSegments = false;
}
} else { } else {
forcedSkipTime = skipTime[1]; forcedSkipTime = forceVideoTime + 0.001;
forcedIncludeIntersectingSegments = true;
forcedIncludeNonIntersectingSegments = false;
} }
} }