diff options
author | Maciej Wilk <[email protected]> | 2021-05-15 01:05:45 +0200 |
---|---|---|
committer | Maciej Wilk <[email protected]> | 2021-05-15 01:05:45 +0200 |
commit | 08a063b6122ad42a6053f78030f442f9f9637ee8 (patch) | |
tree | 475b02bbe4bd964c684fce862d83c12d955cf1c9 | |
parent | 2d14176542e70a5a2badde79d2dd89a0d39a471d (diff) | |
download | SponsorBlock-08a063b6122ad42a6053f78030f442f9f9637ee8.tar.gz SponsorBlock-08a063b6122ad42a6053f78030f442f9f9637ee8.zip |
`if(config.trackViewCount) ` changed
-rw-r--r-- | src/content.ts | 15 |
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); } } } |