mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-17 13:08:54 +03:00
Added check for videoID change not being called
This commit is contained in:
@@ -479,6 +479,10 @@ function startSponsorSchedule(currentTime?: number): void {
|
|||||||
let forcedSkipTime: number = null;
|
let forcedSkipTime: number = null;
|
||||||
|
|
||||||
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
||||||
|
// Double check that the videoID is correct
|
||||||
|
// 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.index, skipInfo.array, skipInfo.openNotice);
|
||||||
|
|
||||||
if (Config.config.disableAutoSkip) {
|
if (Config.config.disableAutoSkip) {
|
||||||
@@ -486,6 +490,14 @@ function startSponsorSchedule(currentTime?: number): void {
|
|||||||
} else {
|
} else {
|
||||||
forcedSkipTime = skipTime[1];
|
forcedSkipTime = skipTime[1];
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Something has really gone wrong
|
||||||
|
console.error("[SponsorBlock] The videoID recorded when trying to skip is different than what it should be.");
|
||||||
|
console.error("[SponsorBlock] VideoID recorded: " + sponsorVideoID + ". Actual VideoID: " + currentVideoID);
|
||||||
|
|
||||||
|
// Video ID change occured
|
||||||
|
videoIDChange(currentVideoID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startSponsorSchedule(forcedSkipTime);
|
startSponsorSchedule(forcedSkipTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user