Filename is too short
vasyl-shumskyi opened this issue · comments
vasyl-shumskyi commented
Hello,
Thanks for the great wrapper! Works flawlessly.
Please consider making filename longer, because it is truncated too much which makes unclear what file is processed.
I tried to increase targetLength
from 10
to larger number in
https://github.com/sidneys/ffmpeg-progressbar-cli/blob/master/lib/formatter.js#L36
But it didn't help
As a workaround for showing full filename I just commented out all filename length checker. And it seems to work now.
if (fileNameLength > targetLength) {
if (fileExtensionLength < (targetLength - 2)) {
// Name too long: ellipse title, leave extension as-is
// filetit….extension
fileName = `${ellipsize(fileTitle, targetLength - fileExtensionLength, { ellipse: ellipseCharacter })}${fileExtension}`
} else {
// Name too long, extension too long: Ellipse title, hide extension
// filetit…
fileName = `${ellipsize(fileTitle, targetLength, { ellipse: ellipseCharacter })}`
}
} else if (fileNameLength < targetLength) {
if (fileNameLength >= (targetLength - 1)) {
// Name too short by less than 2 characters: pad title left
// filetitle.extension
fileName = `${fileTitle}${fileExtension}`.padStart(targetLength, ' ')
} else {
// Name too short by more than 2 characters: Prefix ellipsed directory tree
// …ocuments/filetitle.extension
fileName = `${ellipseCharacter}${filePath.substr(filePath.length - targetLength + 1, filePath.length - 1)}`
}
} else {
// File name has perfect length
fileName = `${fileTitle}${fileExtension}`
}
ale03068 commented
Same thing to me: long file names are cut, also if there is space left on screen
Screenshot: https://imgur.com/eUcOZWn