Fix start sponsor code not functioning as well as it should have

This commit is contained in:
Ajay Ramachandran 2020-04-26 21:46:38 -04:00
parent d23c8b0e1f
commit 797fbf563b

View file

@ -641,12 +641,12 @@ function sponsorsLookup(id: string) {
// See if there are any starting sponsors
let startingSponsor: number = -1;
for (const time of sponsorTimes) {
if (time[0] <= video.currentTime && time.segment[0] > startingSponsor && time.segment[1] > video.currentTime) {
if (time.segment[0] <= video.currentTime && time.segment[0] > startingSponsor && time.segment[1] > video.currentTime) {
startingSponsor = time.segment[0];
break;
}
}
if (!startingSponsor) {
if (startingSponsor === -1) {
for (const time of sponsorTimesSubmitting) {
if (time.segment[0] <= video.currentTime && time.segment[0] > startingSponsor && time.segment[1] > video.currentTime) {
startingSponsor = time.segment[0];