mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-17 03:44:25 +03:00
Potentially fixed zero second skip spam
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "__MSG_Name__",
|
"short_name": "__MSG_Name__",
|
||||||
"version": "1.2.16",
|
"version": "1.2.17",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"content_scripts": [{
|
"content_scripts": [{
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ var lastPreviewBarUpdate;
|
|||||||
//whether the duration listener listening for the duration changes of the video has been setup yet
|
//whether the duration listener listening for the duration changes of the video has been setup yet
|
||||||
var durationListenerSetUp = false;
|
var durationListenerSetUp = false;
|
||||||
|
|
||||||
|
// Has a zero second sponsor been skipped yet
|
||||||
|
var skippedZeroSecond = false;
|
||||||
|
|
||||||
//the channel this video is about
|
//the channel this video is about
|
||||||
var channelURL;
|
var channelURL;
|
||||||
|
|
||||||
@@ -247,6 +250,8 @@ function resetValues() {
|
|||||||
|
|
||||||
//reset sponsor data found check
|
//reset sponsor data found check
|
||||||
sponsorDataFound = false;
|
sponsorDataFound = false;
|
||||||
|
|
||||||
|
skippedZeroSecond = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function videoIDChange(id) {
|
async function videoIDChange(id) {
|
||||||
@@ -455,6 +460,8 @@ function startSponsorSchedule(currentTime?: number): void {
|
|||||||
|
|
||||||
let skippingFunction = () => {
|
let skippingFunction = () => {
|
||||||
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
||||||
|
if (currentTime == 0) skippedZeroSecond = true;
|
||||||
|
|
||||||
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,7 +569,7 @@ function sponsorsLookup(id: string, channelIDPromise?) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zeroSecondSponsor) {
|
if (zeroSecondSponsor && !skippedZeroSecond) {
|
||||||
startSponsorSchedule(0);
|
startSponsorSchedule(0);
|
||||||
} else {
|
} else {
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
|
|||||||
Reference in New Issue
Block a user