Skip to content

Commit

Permalink
Merge pull request #307 from ajayyy/experimental
Browse files Browse the repository at this point in the history
Skipping fixes
ajayyy authored Mar 30, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 7f36c7e + 6d60a90 commit f4a129b
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -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": [{
15 changes: 10 additions & 5 deletions src/content.ts
Original file line number Diff line number Diff line change
@@ -259,7 +259,12 @@ function resetValues() {
//reset sponsor data found check
sponsorDataFound = false;

switchingVideos = true;
if (switchingVideos === null) {
// When first loading a video, it is not switching videos
switchingVideos = false;
} else {
switchingVideos = true;
}
}

async function videoIDChange(id) {
@@ -588,26 +593,26 @@ 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;
}
}
}

if (startingSponsor !== -1) {
startSponsorSchedule(0);
startSponsorSchedule(startingSponsor);
} else {
startSponsorSchedule();
}

0 comments on commit f4a129b

Please sign in to comment.