mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-30 19:38:34 +03:00
Confirm shorter than minDuration submissions
This commit is contained in:
@@ -392,5 +392,8 @@
|
|||||||
},
|
},
|
||||||
"minDurationDescription": {
|
"minDurationDescription": {
|
||||||
"message": "Sponsor segments shorter than the set value will be ignored."
|
"message": "Sponsor segments shorter than the set value will be ignored."
|
||||||
}
|
},
|
||||||
|
"shortCheck": {
|
||||||
|
"message": "One of the segments is shorter than your minimum duration. Do you still want to submit?"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -952,6 +952,14 @@ function submitSponsorTimes() {
|
|||||||
//update sponsorTimesSubmitting
|
//update sponsorTimesSubmitting
|
||||||
sponsorTimesSubmitting = sponsorTimes;
|
sponsorTimesSubmitting = sponsorTimes;
|
||||||
|
|
||||||
|
for (let i = 0; i < sponsorTimes.length; i++) {
|
||||||
|
if (sponsorTimes[i][1] - sponsorTimes[i][0] < SB.config.minDuration) {
|
||||||
|
let confirmShort = chrome.i18n.getMessage("shortCheck") + "\n\n" + getSponsorTimesMessage(sponsorTimes);
|
||||||
|
if(!confirm(confirmShort)) return;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let confirmMessage = chrome.i18n.getMessage("submitCheck") + "\n\n" + getSponsorTimesMessage(sponsorTimes)
|
let confirmMessage = chrome.i18n.getMessage("submitCheck") + "\n\n" + getSponsorTimesMessage(sponsorTimes)
|
||||||
+ "\n\n" + chrome.i18n.getMessage("confirmMSG") + "\n\n" + chrome.i18n.getMessage("guildlinesSummary");
|
+ "\n\n" + chrome.i18n.getMessage("confirmMSG") + "\n\n" + chrome.i18n.getMessage("guildlinesSummary");
|
||||||
if(!confirm(confirmMessage)) return;
|
if(!confirm(confirmMessage)) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user