1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 02:12:30 +01:00

improve error message #1979

This commit is contained in:
Mikael Finstad 2024-05-03 23:59:11 +02:00
parent 3ec3384760
commit 0c751b9c8d
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -62,8 +62,9 @@ function getOutSegProblems({ fileNames, filePath, outputDir, safeOutputFileName
error = i18n.t('At least one resulting file name has no length');
break;
}
if ([...fileName].some((char) => invalidChars.has(char))) {
error = i18n.t('At least one resulting file name contains invalid characters');
const matchingInvalidChars = new Set([...fileName].filter((char) => invalidChars.has(char)));
if (matchingInvalidChars.size > 0) {
error = i18n.t('At least one resulting file name contains invalid character(s): {{invalidChars}}', { invalidChars: `"${[...matchingInvalidChars].join('", "')}"` });
break;
}
if (sameAsInputPath) {