From 0d33794636a80a5ffd7db824a026f8fa951372e9 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 30 Mar 2020 14:11:46 -0400 Subject: [PATCH] Fixed almost zero second sponsors skipping a little too late. --- src/content.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content.ts b/src/content.ts index fc2e6078..410b1989 100644 --- a/src/content.ts +++ b/src/content.ts @@ -597,14 +597,14 @@ function sponsorsLookup(id: string, channelIDPromise?) { // 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; } @@ -612,7 +612,7 @@ function sponsorsLookup(id: string, channelIDPromise?) { } if (startingSponsor !== -1) { - startSponsorSchedule(0); + startSponsorSchedule(startingSponsor); } else { startSponsorSchedule(); }