if(config.trackViewCount) changed

This commit is contained in:
Maciej Wilk 2021-05-15 01:05:45 +02:00
parent 2d14176542
commit 08a063b612
No known key found for this signature in database
GPG key ID: FD172D95D81CD17E

View file

@ -991,7 +991,8 @@ function sendTelemetryAndCount(skippingSegments: SponsorTime[], secondsSkipped:
for (const segment of skippingSegments) {
const index = sponsorTimes.indexOf(segment);
if (index !== -1 && !sponsorSkipped[index]) {
if (Config.config.trackViewCount) {
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;
@ -999,8 +1000,6 @@ function sendTelemetryAndCount(skippingSegments: SponsorTime[], secondsSkipped:
}
if (fullSkip) utils.asyncRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + segment.UUID);
}
sponsorSkipped[index] = true;
}
}
}