Compare commits

..

6 Commits

Author SHA1 Message Date
Ajay Ramachandran
6ccd4b8b37 Merge pull request #297 from ajayyy/experimental
Fix non zero second skips
2020-03-09 23:05:45 -04:00
Ajay Ramachandran
c0894afff9 Prevent manual skipping votes from affecting to UI and happening when auto vote is off 2020-03-09 23:03:24 -04:00
Ajay Ramachandran
09f244150c Fixed skipping for non zero second sponsors.
Also now using the playing event to fix issues with mobile YouTube skipping.
2020-03-09 23:00:39 -04:00
Ajay Ramachandran
efec8b320c Increase version num 2020-03-09 18:38:02 -04:00
Ajay Ramachandran
e6ea9f77e9 Fixed skip scheduling for auto skip 2020-03-09 18:34:33 -04:00
Ajay Ramachandran
0813aa4ba3 Prevent release workflow from running multiple times 2020-03-09 18:30:57 -04:00
4 changed files with 18 additions and 5 deletions

View File

@@ -1,6 +1,8 @@
name: Upload Release Build
on: release
on:
release:
types: [published]
jobs:

View File

@@ -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": [{

View File

@@ -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();
});

View File

@@ -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);
}
}