From 5f879bceabdc8776959197f7b7890001f27ea71c Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 10 Mar 2020 23:30:53 -0400 Subject: [PATCH 1/3] Fixed where repo-token was inputted in release workflow --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7765c18f..21a2fe2a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,12 +67,10 @@ jobs: uses: Shopify/upload-to-release@master with: args: builds/ChromeExtension.zip - env: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload to release uses: Shopify/upload-to-release@master with: args: builds/FirefoxExtension.zip - env: repo-token: ${{ secrets.GITHUB_TOKEN }} From 0467dd5d2163df13eec0dd53da41af7b953f2511 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Wed, 11 Mar 2020 19:39:08 -0400 Subject: [PATCH 2/3] Made sure no skips are scheduled while paused --- src/content.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content.ts b/src/content.ts index 218a5401..dd1e6e47 100644 --- a/src/content.ts +++ b/src/content.ts @@ -452,6 +452,7 @@ function cancelSponsorSchedule(): void { */ function startSponsorSchedule(currentTime?: number): void { cancelSponsorSchedule(); + if (video.paused) return; if (Config.config.disableSkipping || channelWhitelisted){ return; From ed67cc52fef353e8c85e1b71f967661cdb117a0d Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 21 Mar 2020 20:59:08 -0400 Subject: [PATCH 3/3] Fixed mobile YouTube starting sponsor detection that are not exactly 0 seconds. --- src/content.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/content.ts b/src/content.ts index dd1e6e47..ac2770c8 100644 --- a/src/content.ts +++ b/src/content.ts @@ -588,25 +588,25 @@ function sponsorsLookup(id: string, channelIDPromise?) { UUIDs = smallUUIDs; } - // See if there are any zero second sponsors - let zeroSecondSponsor = false; - for (const time of sponsorTimes) { - if (time[0] <= 0) { - zeroSecondSponsor = true; - break; - } - } - if (!zeroSecondSponsor) { - for (const time of sponsorTimesSubmitting) { - if (time[0] <= 0) { - zeroSecondSponsor = true; + if (!video.paused && !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) { + startingSponsor = time[0]; break; } } - } + if (!startingSponsor) { + for (const time of sponsorTimesSubmitting) { + if (time[0] <= video.currentTime && time[0] > startingSponsor) { + startingSponsor = time[0]; + break; + } + } + } - if (!video.paused && !switchingVideos) { - if (zeroSecondSponsor) { + if (startingSponsor !== -1) { startSponsorSchedule(0); } else { startSponsorSchedule();