mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-24 00:18:27 +03:00
Discard short segments instead of ignoring them later
This commit is contained in:
11
content.js
11
content.js
@@ -341,6 +341,13 @@ function sponsorsLookup(id, channelIDPromise) {
|
||||
sponsorTimes = JSON.parse(xmlhttp.responseText).sponsorTimes;
|
||||
UUIDs = JSON.parse(xmlhttp.responseText).UUIDs;
|
||||
|
||||
for (let i = 0; i < sponsorTimes.length; i++) {
|
||||
if (sponsorTimes[i][1] - sponsorTimes[i][0] < SB.config.minDuration) {
|
||||
sponsorTimes.splice(i, 1);
|
||||
UUIDs.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset skip save
|
||||
sponsorSkipped = [];
|
||||
|
||||
@@ -521,10 +528,6 @@ function checkSponsorTime(sponsorTimes, index, openNotice) {
|
||||
lastTime = v.currentTime - 0.0001;
|
||||
}
|
||||
|
||||
if (sponsorTimes[index][1] - sponsorTimes[index][0] < SB.config.minDuration) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (checkIfTimeToSkip(v.currentTime, sponsorTimes[index][0], sponsorTimes[index][1]) && !hiddenSponsorTimes.includes(index)) {
|
||||
//skip it
|
||||
skipToTime(v, index, sponsorTimes, openNotice);
|
||||
|
||||
Reference in New Issue
Block a user