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

ERROR: Cannot bind argument to parameter 'Path' because it is an empty string. #67

Closed
alekdavis opened this issue May 10, 2020 · 4 comments · Fixed by #71 or #73
Closed

ERROR: Cannot bind argument to parameter 'Path' because it is an empty string. #67

alekdavis opened this issue May 10, 2020 · 4 comments · Fixed by #71 or #73
Assignees
Labels
Milestone

Comments

@alekdavis
Copy link

alekdavis commented May 10, 2020

At the very beginning of the run, the script generates this error:

Test-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
At C:\conv2mp4\files\func\validate\ValidateOutPath.ps1:7 char:25
+     If (-Not (Test-Path $Path)) {                                                                                     +                         ~~~~~                                                                                             + CategoryInfo          : InvalidData: (:) [Test-Path], ParameterBindingValidationException                             + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Test     PathCommand

I think it tries to validate the output path, which is empty (I assume that output path is only needed if the output file goes to a special folder, and I want conversion to be in place). So my config file is this:

use_out_path=false
out_path=

Bug? Feature? (I'm using v4.1.2 of the script)

P.S. Btw, instructions in the issue template suggest labeling bugs as such, but I think only repository owner can do this. I know I can label issues in my repositories, but I cannot in this one.

@alekdavis alekdavis changed the title Error: Cannot bind argument to parameter 'Path' because it is an empty string. ERROR: Cannot bind argument to parameter 'Path' because it is an empty string. May 10, 2020
@BrianDMG
Copy link
Owner

Pinpointed this as an issue with the outPath validation, working on a fix as I type this.

@alekdavis
Copy link
Author

Sweet. I also noticed that after a run, I am left with a lot of _NEW.mp4 files next to the original videos. The mp4 files seem to be final (i.e. they play fine), but for some reason the old files are not cleaned up. It does not happen always (some do get cleaned up), so not sure if this is related to something else or one of the bugs I reported.

@BrianDMG BrianDMG self-assigned this Jun 20, 2020
@BrianDMG BrianDMG added the Bug label Jun 20, 2020
@BrianDMG BrianDMG added this to the 4.2 milestone Jun 20, 2020
BrianDMG added a commit that referenced this issue Jun 20, 2020
- Closes #67 
- Closes #68
- Intermediary file (target file) now takes on a non-media file extension (.conv2mp4) while encoding is underway in order to prevent it from being scanned/picked up by media scanners (Plex media scanner, etc.) before it is completed. The file extension is restored to .mp4 once encoding has completed.
@BrianDMG
Copy link
Owner

Just pushed a fix for this to develop branch, test that out and see if it resolves your issue. I would presume the files not being cleaned up properly is related to the outPath issue. This issue never cropped up on my personal machine because I have a placeholder path set for outPath, despite useOutPath being false, so I believe you having that value as empty is what was causing this issue. It's a bug either way, so thanks for taking the time to point it out.

@alekdavis
Copy link
Author

Seems to be working now. No errors so far.

@BrianDMG BrianDMG linked a pull request Aug 4, 2020 that will close this issue
BrianDMG added a commit that referenced this issue Aug 4, 2020
@BrianDMG BrianDMG mentioned this issue Aug 4, 2020
BrianDMG added a commit that referenced this issue Aug 4, 2020
- Improved metadata parsing
- Bug fixes
   - Closes #67
   - Closes #68
   - Closes #70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants