Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into misc-fix

This commit is contained in:
Michael C
2022-01-27 14:56:47 -05:00
5 changed files with 15 additions and 5 deletions

View File

@@ -725,9 +725,16 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
// Hide all submissions smaller than the minimum duration
if (Config.config.minDuration !== 0) {
for (const segment of sponsorTimes) {
if (segment.segment[1] - segment.segment[0] < Config.config.minDuration
&& segment.actionType !== ActionType.Poi)
const duration = segment[1] - segment[0];
if (duration > 0 && duration < Config.config.minDuration) {
segment.hidden = SponsorHideType.MinimumDuration;
}
}
for (let i = 0; i < sponsorTimes.length; i++) {
const duration = sponsorTimes[i].segment[1] - sponsorTimes[i].segment[0] ;
if (duration > 0 && duration < Config.config.minDuration) {
sponsorTimes[i].hidden = SponsorHideType.MinimumDuration;
}
}
}
@@ -1877,7 +1884,7 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string {
let timeMessage = utils.getFormattedTime(sponsorTimes[i].segment[s]);
//if this is an end time
if (s == 1) {
timeMessage = " to " + timeMessage;
timeMessage = " " + chrome.i18n.getMessage("to") + " " + timeMessage;
} else if (i > 0) {
//add commas if necessary
timeMessage = ", " + timeMessage;