From 08c7754f291650d5b6265eb0f75ed8387cd7ca64 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 8 Feb 2020 17:50:06 -0500 Subject: [PATCH] Fixed skip count resetting. Resolves https://github.com/ajayyy/SponsorBlock/issues/256 --- src/content.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/content.ts b/src/content.ts index 48ab5afb..9bbf4477 100644 --- a/src/content.ts +++ b/src/content.ts @@ -636,6 +636,7 @@ function skipToTime(v, index, sponsorTimes, openNotice) { // Count this as a skip Config.config.minutesSaved = Config.config.minutesSaved + (sponsorTimes[index][1] - sponsorTimes[index][0]) / 60; Config.config.skipCount = Config.config.skipCount + 1; + sponsorSkipped[index] = true; } } @@ -921,12 +922,10 @@ function vote(type, UUID, skipNotice) { sponsorSkipped[sponsorIndex] = false; } - // Count this as a skip - Config.config.minutesSaved = Config.config.minutesSaved + factor * (sponsorTimes[sponsorIndex][1] - sponsorTimes[sponsorIndex][0]) / 60; - - Config.config.skipCount = 0; - - Config.config.skipCount = Config.config.skipCount + factor * 1; + // Count this as a skip + Config.config.minutesSaved = Config.config.minutesSaved + factor * (sponsorTimes[sponsorIndex][1] - sponsorTimes[sponsorIndex][0]) / 60; + + Config.config.skipCount = Config.config.skipCount + factor; } chrome.runtime.sendMessage({