improve error msg #2890

pull/2803/merge
Mikael Finstad 1 month ago
parent 260521b451
commit 260528d845
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -223,7 +223,12 @@ export async function askForSegmentDuration({ totalDuration, inputPlaceholder, p
const segmentDuration = parseTimecode(v);
if (segmentDuration != null) {
const numSegments = Math.ceil(totalDuration / segmentDuration);
if (segmentDuration > 0 && segmentDuration < totalDuration && numSegments <= maxSegments) return null;
if (segmentDuration > 0 && numSegments <= maxSegments) {
if (segmentDuration < totalDuration) {
return null;
}
return i18n.t('Value must be shorter than total duration ({{totalDuration}})', { totalDuration: formatDuration({ seconds: totalDuration, shorten: true }) });
}
}
return i18n.t('Please input a valid duration. Example: {{example}}', { example: inputPlaceholder });
},

Loading…
Cancel
Save