Discard short segments instead of ignoring them later

This commit is contained in:
Lartza
2020-02-05 01:12:03 +02:00
parent edb108bbcf
commit b5996a9783
2 changed files with 8 additions and 5 deletions

View File

@@ -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);