Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename is too short #12

Open
vasyl-shumskyi opened this issue Jan 17, 2020 · 1 comment
Open

Filename is too short #12

vasyl-shumskyi opened this issue Jan 17, 2020 · 1 comment

Comments

@vasyl-shumskyi
Copy link

vasyl-shumskyi commented Jan 17, 2020

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.

Screen Shot 2020-01-17 at 17 42 58

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
Copy link

Same thing to me: long file names are cut, also if there is space left on screen
Screenshot: https://imgur.com/eUcOZWn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants