mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Added check for videoID change not being called
This commit is contained in:
parent
4a6ddf6774
commit
a9993d5d80
1 changed files with 16 additions and 4 deletions
|
@ -479,12 +479,24 @@ function startSponsorSchedule(currentTime?: number): void {
|
|||
let forcedSkipTime: number = null;
|
||||
|
||||
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
||||
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
||||
// 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);
|
||||
|
||||
if (Config.config.disableAutoSkip) {
|
||||
forcedSkipTime = skipTime[0] + 0.001;
|
||||
if (Config.config.disableAutoSkip) {
|
||||
forcedSkipTime = skipTime[0] + 0.001;
|
||||
} else {
|
||||
forcedSkipTime = skipTime[1];
|
||||
}
|
||||
} else {
|
||||
forcedSkipTime = skipTime[1];
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue