Merge pull request #307 from ajayyy/experimental

Skipping fixes
This commit is contained in:
Ajay Ramachandran
2020-03-30 14:34:31 -04:00
committed by GitHub
2 changed files with 11 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "__MSG_Name__",
"version": "1.2.22",
"version": "1.2.23",
"default_locale": "en",
"description": "__MSG_Description__",
"content_scripts": [{

View File

@@ -259,8 +259,13 @@ function resetValues() {
//reset sponsor data found check
sponsorDataFound = false;
if (switchingVideos === null) {
// When first loading a video, it is not switching videos
switchingVideos = false;
} else {
switchingVideos = true;
}
}
async function videoIDChange(id) {
//if the id has not changed return
@@ -588,18 +593,18 @@ function sponsorsLookup(id: string, channelIDPromise?) {
UUIDs = smallUUIDs;
}
if (!video.paused && !switchingVideos) {
if (!switchingVideos) {
// See if there are any starting sponsors
let startingSponsor: number = -1;
for (const time of sponsorTimes) {
if (time[0] <= video.currentTime && time[0] > startingSponsor) {
if (time[0] <= video.currentTime && time[0] > startingSponsor && time[1] > video.currentTime) {
startingSponsor = time[0];
break;
}
}
if (!startingSponsor) {
for (const time of sponsorTimesSubmitting) {
if (time[0] <= video.currentTime && time[0] > startingSponsor) {
if (time[0] <= video.currentTime && time[0] > startingSponsor && time[1] > video.currentTime) {
startingSponsor = time[0];
break;
}
@@ -607,7 +612,7 @@ function sponsorsLookup(id: string, channelIDPromise?) {
}
if (startingSponsor !== -1) {
startSponsorSchedule(0);
startSponsorSchedule(startingSponsor);
} else {
startSponsorSchedule();
}