mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-25 17:08:42 +03:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ccd4b8b37 | ||
|
|
c0894afff9 | ||
|
|
09f244150c | ||
|
|
efec8b320c | ||
|
|
e6ea9f77e9 | ||
|
|
0813aa4ba3 | ||
|
|
ba575f6b8d | ||
|
|
ff9b2338e0 | ||
|
|
d2bb4b38e3 | ||
|
|
760c08dd0c | ||
|
|
50517eb462 |
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@@ -1,6 +1,8 @@
|
|||||||
name: Upload Release Build
|
name: Upload Release Build
|
||||||
|
|
||||||
on: release
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@@ -62,15 +64,15 @@ jobs:
|
|||||||
|
|
||||||
# Upload each release asset
|
# Upload each release asset
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
uses: JasonEtco/upload-to-release@master
|
uses: Shopify/upload-to-release@master
|
||||||
with:
|
with:
|
||||||
args: ./builds/ChromeExtension.zip
|
args: builds/ChromeExtension.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
uses: JasonEtco/upload-to-release@master
|
uses: Shopify/upload-to-release@master
|
||||||
with:
|
with:
|
||||||
args: ./builds/FirefoxExtension.zip
|
args: builds/FirefoxExtension.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "__MSG_Name__",
|
"short_name": "__MSG_Name__",
|
||||||
"version": "1.2.19",
|
"version": "1.2.21",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"content_scripts": [{
|
"content_scripts": [{
|
||||||
|
|||||||
@@ -449,7 +449,7 @@ function startSponsorSchedule(currentTime?: number): void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentTime === undefined) currentTime = video.currentTime;
|
if (currentTime === undefined || currentTime === null) currentTime = video.currentTime;
|
||||||
|
|
||||||
let skipInfo = getNextSkipIndex(currentTime);
|
let skipInfo = getNextSkipIndex(currentTime);
|
||||||
|
|
||||||
@@ -459,11 +459,19 @@ function startSponsorSchedule(currentTime?: number): void {
|
|||||||
let timeUntilSponsor = skipTime[0] - currentTime;
|
let timeUntilSponsor = skipTime[0] - currentTime;
|
||||||
|
|
||||||
let skippingFunction = () => {
|
let skippingFunction = () => {
|
||||||
|
let forcedSkipTime: number = null;
|
||||||
|
|
||||||
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
||||||
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
||||||
|
|
||||||
|
if (Config.config.disableAutoSkip) {
|
||||||
|
forcedSkipTime = skipTime[0] + 0.001;
|
||||||
|
} else {
|
||||||
|
forcedSkipTime = skipTime[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startSponsorSchedule(skipTime[1]);
|
startSponsorSchedule(forcedSkipTime);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (timeUntilSponsor <= 0) {
|
if (timeUntilSponsor <= 0) {
|
||||||
@@ -495,6 +503,7 @@ function sponsorsLookup(id: string, channelIDPromise?) {
|
|||||||
switchingVideos = false;
|
switchingVideos = false;
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
});
|
});
|
||||||
|
video.addEventListener('playing', () => startSponsorSchedule());
|
||||||
video.addEventListener('seeked', () => {
|
video.addEventListener('seeked', () => {
|
||||||
if (!video.paused) startSponsorSchedule();
|
if (!video.paused) startSponsorSchedule();
|
||||||
});
|
});
|
||||||
@@ -848,10 +857,9 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//send telemetry that a this sponsor was skipped
|
//send telemetry that a this sponsor was skipped
|
||||||
if (Config.config.trackViewCount && !sponsorSkipped[index]) {
|
if (Config.config.trackViewCount && !sponsorSkipped[index] && !Config.config.disableAutoSkip) {
|
||||||
utils.sendRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
|
utils.sendRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
|
||||||
|
|
||||||
if (!Config.config.disableAutoSkip) {
|
|
||||||
// Count this as a skip
|
// Count this as a skip
|
||||||
Config.config.minutesSaved = Config.config.minutesSaved + (sponsorTimes[index][1] - sponsorTimes[index][0]) / 60;
|
Config.config.minutesSaved = Config.config.minutesSaved + (sponsorTimes[index][1] - sponsorTimes[index][0]) / 60;
|
||||||
Config.config.skipCount = Config.config.skipCount + 1;
|
Config.config.skipCount = Config.config.skipCount + 1;
|
||||||
@@ -859,7 +867,6 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
|
|||||||
sponsorSkipped[index] = true;
|
sponsorSkipped[index] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function unskipSponsorTime(UUID) {
|
function unskipSponsorTime(UUID) {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
import Config from "../config";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The notice that tells the user that a sponsor was just skipped
|
* The notice that tells the user that a sponsor was just skipped
|
||||||
*/
|
*/
|
||||||
@@ -305,7 +307,7 @@ class SkipNotice {
|
|||||||
if (this.manualSkip) {
|
if (this.manualSkip) {
|
||||||
this.changeNoticeTitle(chrome.i18n.getMessage("noticeTitle"));
|
this.changeNoticeTitle(chrome.i18n.getMessage("noticeTitle"));
|
||||||
|
|
||||||
this.contentContainer().vote(1, this.UUID, this);
|
if (Config.config.autoUpvote) this.contentContainer().vote(1, this.UUID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user