diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3aaacaf..dae30ed1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,8 @@ name: Upload Release Build -on: release +on: + release: + types: [published] jobs: diff --git a/manifest/manifest.json b/manifest/manifest.json index 409c78fa..022929c3 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "__MSG_Name__", - "version": "1.2.20", + "version": "1.2.21", "default_locale": "en", "description": "__MSG_Description__", "content_scripts": [{ diff --git a/src/content.ts b/src/content.ts index 7017fadc..37212201 100644 --- a/src/content.ts +++ b/src/content.ts @@ -449,7 +449,7 @@ function startSponsorSchedule(currentTime?: number): void { return; } - if (currentTime === undefined) currentTime = video.currentTime; + if (currentTime === undefined || currentTime === null) currentTime = video.currentTime; let skipInfo = getNextSkipIndex(currentTime); @@ -459,11 +459,19 @@ function startSponsorSchedule(currentTime?: number): void { let timeUntilSponsor = skipTime[0] - currentTime; let skippingFunction = () => { + let forcedSkipTime: number = null; + if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) { skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice); + + if (Config.config.disableAutoSkip) { + forcedSkipTime = skipTime[0] + 0.001; + } else { + forcedSkipTime = skipTime[1]; + } } - startSponsorSchedule(skipTime[0] + 0.001); + startSponsorSchedule(forcedSkipTime); }; if (timeUntilSponsor <= 0) { @@ -495,6 +503,7 @@ function sponsorsLookup(id: string, channelIDPromise?) { switchingVideos = false; startSponsorSchedule(); }); + video.addEventListener('playing', () => startSponsorSchedule()); video.addEventListener('seeked', () => { if (!video.paused) startSponsorSchedule(); }); diff --git a/src/js-components/skipNotice.ts b/src/js-components/skipNotice.ts index 3e981851..ec55f9b7 100644 --- a/src/js-components/skipNotice.ts +++ b/src/js-components/skipNotice.ts @@ -1,5 +1,7 @@ 'use strict'; +import Config from "../config"; + /** * The notice that tells the user that a sponsor was just skipped */ @@ -305,7 +307,7 @@ class SkipNotice { if (this.manualSkip) { this.changeNoticeTitle(chrome.i18n.getMessage("noticeTitle")); - this.contentContainer().vote(1, this.UUID, this); + if (Config.config.autoUpvote) this.contentContainer().vote(1, this.UUID); } }