mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 05:27:03 +03:00
Fixed curly bracket that for some reason was in the wrong place.
This commit is contained in:
39
content.js
39
content.js
@@ -150,31 +150,30 @@ function sponsorsLookup(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sponsorCheck(sponsorTimes) { // Video skipping
|
function sponsorCheck(sponsorTimes) { // Video skipping
|
||||||
//see if any sponsor start time was just passed
|
//see if any sponsor start time was just passed
|
||||||
for (let i = 0; i < sponsorTimes.length; i++) {
|
for (let i = 0; i < sponsorTimes.length; i++) {
|
||||||
//the sponsor time is in between these times, skip it
|
//the sponsor time is in between these times, skip it
|
||||||
//if the time difference is more than 1 second, than the there was probably a skip in time,
|
//if the time difference is more than 1 second, than the there was probably a skip in time,
|
||||||
// and it's not due to playback
|
// and it's not due to playback
|
||||||
if (Math.abs(v.currentTime - lastTime) < 1 && sponsorTimes[i][0] >= lastTime && sponsorTimes[i][0] <= v.currentTime) {
|
if (Math.abs(v.currentTime - lastTime) < 1 && sponsorTimes[i][0] >= lastTime && sponsorTimes[i][0] <= v.currentTime) {
|
||||||
//skip it
|
//skip it
|
||||||
v.currentTime = sponsorTimes[i][1];
|
v.currentTime = sponsorTimes[i][1];
|
||||||
|
|
||||||
lastSponsorTimeSkipped = sponsorTimes[i][0];
|
lastSponsorTimeSkipped = sponsorTimes[i][0];
|
||||||
|
|
||||||
let currentUUID = UUIDs[i];
|
let currentUUID = UUIDs[i];
|
||||||
lastSponsorTimeSkippedUUID = currentUUID;
|
lastSponsorTimeSkippedUUID = currentUUID;
|
||||||
|
|
||||||
//send out the message saying that a sponsor message was skipped
|
//send out the message saying that a sponsor message was skipped
|
||||||
openSkipNotice();
|
openSkipNotice();
|
||||||
|
|
||||||
setTimeout(() => closeSkipNotice(currentUUID), 7000);
|
setTimeout(() => closeSkipNotice(currentUUID), 7000);
|
||||||
|
|
||||||
//send telemetry that a this sponsor was skipped happened
|
//send telemetry that a this sponsor was skipped happened
|
||||||
sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
|
sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
|
||||||
}
|
|
||||||
|
|
||||||
lastTime = v.currentTime;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
lastTime = v.currentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
function goBackToPreviousTime(UUID) {
|
function goBackToPreviousTime(UUID) {
|
||||||
|
|||||||
Reference in New Issue
Block a user