aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaciej Wilk <[email protected]>2021-05-15 01:05:45 +0200
committerMaciej Wilk <[email protected]>2021-05-15 01:05:45 +0200
commit08a063b6122ad42a6053f78030f442f9f9637ee8 (patch)
tree475b02bbe4bd964c684fce862d83c12d955cf1c9
parent2d14176542e70a5a2badde79d2dd89a0d39a471d (diff)
downloadSponsorBlock-08a063b6122ad42a6053f78030f442f9f9637ee8.tar.gz
SponsorBlock-08a063b6122ad42a6053f78030f442f9f9637ee8.zip
`if(config.trackViewCount) ` changed
-rw-r--r--src/content.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/content.ts b/src/content.ts
index 9e5b32ca..d83c003f 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -991,15 +991,14 @@ function sendTelemetryAndCount(skippingSegments: SponsorTime[], secondsSkipped:
for (const segment of skippingSegments) {
const index = sponsorTimes.indexOf(segment);
if (index !== -1 && !sponsorSkipped[index]) {
- if (Config.config.trackViewCount) {
- if (!counted) {
- Config.config.minutesSaved = Config.config.minutesSaved + secondsSkipped / 60;
- Config.config.skipCount = Config.config.skipCount + 1;
- counted = true
- }
- if (fullSkip) utils.asyncRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + segment.UUID);
- }
sponsorSkipped[index] = true;
+ if (!Config.config.trackViewCount) return
+ if (!counted) {
+ Config.config.minutesSaved = Config.config.minutesSaved + secondsSkipped / 60;
+ Config.config.skipCount = Config.config.skipCount + 1;
+ counted = true
+ }
+ if (fullSkip) utils.asyncRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + segment.UUID);
}
}
}