{expression} help

All about user-defined episode / movie / file name format expressions
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

Re: Learn how {expressions} work and useful Helper Functions

Post by ChefGregS »

Hey rednoah.... I am getting the irritating "Binding "pi" undefined. I don't understand why it's an error because when OTHER bindings are undefined it doesn't always give an error. I have read some stuff and testing some fixes but nothing seems to get rid of the error. My recent attempt is this:

{if (pi) ' [Part '+ pi +'] '}

WHICH, if I have read everything correctly tests for the binding and if it's not there simply ignore it. Am I correct? If not, why? (trying to learn by mistakes...best way hehe)

Even with that error, oddly enough, if there is no part number for a movie nothing shows up in the file name...and if there IS a part number, it puts it in correctly as I want it to. This error is in the TEST file under the format code section when I am creating the code. Seems odd that the error would be identified yet the code works perfectly.. And as I said..other bindings that are NOT defined don't show that error ...or maybe I just don't see them because of this one..
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Learn how {expressions} work and useful Helper Functions

Post by rednoah »

That's not an error. It's just an information message to tell you that an expression has returned without value, which may or may be what you want.

If the expression is not working the way you expect, then it's worth looking at the messages. If it's working as expected, then you can ignore the messages.

In this particular case, pi will always fail for single part movies, because you want {'.CD'+pi} to either yield .CD1 or nothing at all, but definitely not succeed and return .CDnull.

If you want to gobble up the message or warning, then you can do this any{'.CD'+pi}{null} where any(Closure...) by design gobbles up failed expressions and runs another one instead which does yield a value successfully.
:idea: Please read the FAQ and How to Request Help.
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

Re: Learn how {expressions} work and useful Helper Functions

Post by ChefGregS »

Great.. thanks. I’ll have another one for you later when I get home from church.. :)

Strange behavior popped up last night on my end code yet only affecting a few files but I want to understand it..
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

Re: Learn how {expressions} work and useful Helper Functions

Post by ChefGregS »

1) Dropping a donation (20 Euros) because you absolutely deserve it for all your help!!

2) I actually figured out the problem I was having by studying all your replies...and poof..I saw the problem.

This leads me to another question, however, since it has nothing really to do with expressions or functions I will post a new topic.

Thanks for all your help!!!!

- Greg (as Truthinhisword.com)
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

Re: Learn how {expressions} work and useful Helper Functions

Post by ChefGregS »

Ok...found a question that does fit in this category. :)

I have several files that for whatever reason do NOT have 'vf' defined. However, they do have 'hpi' defined. I would use this except from what I gather from all I looked at it is the ACTUAL size not rounded (or however they figure it.) In my code, the way I have it set, not having 'vf' defined throws an error. Not a big deal except that at the beginning of my code 'vf' is checked to determine the folder to put the movie in. As of right now, 'vf' being undefined means all the movies drop all the way to the root folder for my media. Also, those files then end up with [] at the end since nothing to go in there. I can fix that one and can figure out how to fix the folder issue as well. My question is this, though:

How would that information NOT be defined in the file? I didn't even know that was possible. When I do a 'properties' of the file I see the information listed there.

1) So why does Filebot NOT see it if I can see it?
2) Is it possible to edit the file in some way that will make Filebot see that information? (This would be very handy as I would insert the correct info into MANY files in many of the properties if I know how to do it...) Is there a program that would do this?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Learn how {expressions} work and useful Helper Functions

Post by rednoah »

Please copy & paste the raw MediaInfo table of a file where {vf} doesn't work:
viewtopic.php?f=5&t=4285

{vf} is based on Video Height and Video Width only, so if {width} and {height} work, so should {vf}.
:idea: Please read the FAQ and How to Request Help.
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

Re: Learn how {expressions} work and useful Helper Functions

Post by ChefGregS »

Not sure if this is what you wanted...but here is a shot of several movies all with nothing in the vf field and one with the field filled. Also a shot of the file data from one of those movies with nothing in that VF field in the bindings. It also has the end part of my code where it should be listed.

If this isn't what you wanted to see please let me know..Image

Greg
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Learn how {expressions} work and useful Helper Functions

Post by rednoah »

Almost. Please click the Image button to view the MediaInfo table. Then use CTRL+A to copy & paste the entire table here in the forums.

If you could somehow provide (e.g. cut a few seconds) a small sample of the file that doesn't work, that would be really useful too.

Please try with a file where this is an issue, in the Format Editor, and only use {vf} as binding so you can see the warning / error message if any. It'll probably say Illegal resolution: [W, H] because there is no valid {vf} value for files less than 240p.

:arrow: TL;DR {vf} doesn't yield any value for files less than 320x240 by design. What {vf} value did you expect for your low-resolution files?
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 114
Joined: 27 Oct 2015, 02:59

Re: Learn how {expressions} work and useful Helper Functions

Post by Wolfie »

I know this is a slightly old discussion but what's your expression looking like now?
Post Reply