aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2019-07-23 19:33:12 -0400
committerAjay Ramachandran <[email protected]>2019-07-23 19:33:12 -0400
commit9913e99a6acfb4fcc83edd708235fda904b2fc0e (patch)
tree0f741043c747e5759b0e2d3c746cad5e9c608222
parentc91c08a17f1292ce26c20bbccc64dc2731010701 (diff)
downloadSponsorBlock-9913e99a6acfb4fcc83edd708235fda904b2fc0e.tar.gz
SponsorBlock-9913e99a6acfb4fcc83edd708235fda904b2fc0e.zip
Fixed curly bracket that for some reason was in the wrong place.
-rw-r--r--content.js47
1 files changed, 23 insertions, 24 deletions
diff --git a/content.js b/content.js
index 2b51f7f9..35febc3a 100644
--- a/content.js
+++ b/content.js
@@ -150,31 +150,30 @@ function sponsorsLookup(id) {
}
function sponsorCheck(sponsorTimes) { // Video skipping
- //see if any sponsor start time was just passed
- for (let i = 0; i < sponsorTimes.length; i++) {
- //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,
- // and it's not due to playback
- if (Math.abs(v.currentTime - lastTime) < 1 && sponsorTimes[i][0] >= lastTime && sponsorTimes[i][0] <= v.currentTime) {
- //skip it
- v.currentTime = sponsorTimes[i][1];
-
- lastSponsorTimeSkipped = sponsorTimes[i][0];
-
- let currentUUID = UUIDs[i];
- lastSponsorTimeSkippedUUID = currentUUID;
-
- //send out the message saying that a sponsor message was skipped
- openSkipNotice();
-
- setTimeout(() => closeSkipNotice(currentUUID), 7000);
-
- //send telemetry that a this sponsor was skipped happened
- sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
- }
-
- lastTime = v.currentTime;
+ //see if any sponsor start time was just passed
+ for (let i = 0; i < sponsorTimes.length; i++) {
+ //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,
+ // and it's not due to playback
+ if (Math.abs(v.currentTime - lastTime) < 1 && sponsorTimes[i][0] >= lastTime && sponsorTimes[i][0] <= v.currentTime) {
+ //skip it
+ v.currentTime = sponsorTimes[i][1];
+
+ lastSponsorTimeSkipped = sponsorTimes[i][0];
+
+ let currentUUID = UUIDs[i];
+ lastSponsorTimeSkippedUUID = currentUUID;
+
+ //send out the message saying that a sponsor message was skipped
+ openSkipNotice();
+
+ setTimeout(() => closeSkipNotice(currentUUID), 7000);
+
+ //send telemetry that a this sponsor was skipped happened
+ sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
}
+ }
+ lastTime = v.currentTime;
}
function goBackToPreviousTime(UUID) {