INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Quixote: MC 12.0.120 Expression Issue  (Read 1104 times)

Quixote

  • Regular Member
  • World Citizen
  • ***
  • Posts: 158
  • Change this by choosing profile
Quixote: MC 12.0.120 Expression Issue
« on: November 27, 2006, 06:54:49 pm »

The literal key used with a comma (/,) inside an IF expression is not returning a comma literal:

Example (Filename from Properties):

     [Album Artist]\If(IsEmpty([mySeries#]),,Book/, [mySeries#] - )[Album]

Returns:    Anne McCaffrey\0DragonSong
Expected:  Anne McCaffrey\Book, 1 - DragonSong


It looks like the expression is interpreting the last comma as part the of parameter delimiters.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42041
  • Shoes gone again!
Re: Quixote: MC 12.0.120 Expression Issue
« Reply #1 on: November 29, 2006, 11:46:04 am »

Your expression (modified slightly to use fields I have) works.  The comma's come through alright.

I'm guessing the issue is that "IsEmpty(...)" is doing a string empty test, and "0" is not empty.

To do a numeric empty test, use:
IsEmpty([mySeries#], 1)

Let us know if this shores it up.
Logged
Matt Ashland, JRiver Media Center

Quixote

  • Regular Member
  • World Citizen
  • ***
  • Posts: 158
  • Change this by choosing profile
Re: Quixote: MC 12.0.120 Expression Issue
« Reply #2 on: November 29, 2006, 01:41:36 pm »

I'm getting the same results only now I'm getting a 1 instead of a 0:

Example (Filename from Properties):

Using the Directories->Rule
     [Album Artist]\If(IsEmpty([mySeries#],1),,Book/, [mySeries#] - )[Album]

Returns:    Anne McCaffrey\1DragonSong
Expected:  Anne McCaffrey\Book, 1 - DragonSong

HOWEVER:
Using the formula in the Filename->Rule I get the Expected result using either IsEmpty() string or numeric functions (the field is defined as a String).

So the issue seems to be contained only in the Directories->Rule part of the dialog.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8967
Re: Quixote: MC 12.0.120 Expression Issue
« Reply #3 on: November 29, 2006, 03:10:03 pm »

change the isempty to isequal...

[Album Artist]\If(Isequal([mySeries#],unknown,8),,Book/, [mySeries#] - )[Album]

see if that helps..

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42041
  • Shoes gone again!
Re: Quixote: MC 12.0.120 Expression Issue
« Reply #4 on: November 29, 2006, 03:23:14 pm »

Empty [myExpression#] becomes "Unknown My Expression" in a directory rule.  You'll have to do some legwork to side-step this.

Marko beat me to it.  He's right.
Logged
Matt Ashland, JRiver Media Center

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8967
Re: Quixote: MC 12.0.120 Expression Issue
« Reply #5 on: November 30, 2006, 03:00:16 pm »

IsEmpty([field],0) is not returning "1" on empty string fields

Renaming this file using IsEmpty([Artist]) should return a "1".  Notice the artist field is empty.


Returns a "0" instead.

try using the following:

if(isempty([artist]),1,[artist])

it says, "if [artist] is empty, use 1, otherwise, use [artist]"

You should see your file renamed to "unknown artist.jpg". Use isequal([artist],unknown,8) to get past this one.

This only applies for the rename from properties tool. If you try these two expressions in the search box, you will see the results you expect...

[=isempty([artist])]=1
[=isempty([artist])]=0

-marko.
Pages: [1]   Go Up