INTERACT FORUM

Please login or register.

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

Author Topic: How to create a list of "Band" and "Album Artist" field different  (Read 1608 times)

stumpygremlin

  • World Citizen
  • ***
  • Posts: 121
How to create a list of "Band" and "Album Artist" field different
« on: September 15, 2012, 06:24:48 pm »

I'm wondering how to create a smart playlist that'll show me the songs in which I labeled the "Band" and "Album Artist" fields differently.

Thanks!
Logged

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: How to create a list of "Band" and "Album Artist" field different
« Reply #1 on: September 15, 2012, 07:46:40 pm »

-[Band]=[] [=IsEqual([Album Artist (auto)], [Band])]=0

'Import' this using a Search Wizard. From the Wizard, note the form of such a 'Custom' rule is [{Expression}]=0|1 (i.e., False|True).
Logged

stumpygremlin

  • World Citizen
  • ***
  • Posts: 121
Re: How to create a list of "Band" and "Album Artist" field different
« Reply #2 on: September 15, 2012, 07:56:57 pm »

You, sir, are awesome! Thanks a bunch!
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: How to create a list of "Band" and "Album Artist" field different
« Reply #3 on: September 17, 2012, 12:08:47 am »

<snip> note the form of such a 'Custom' rule is [={Expression}]=0|1 (i.e., False|True).
missing "equals" added in red ;)

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: How to create a list of "Band" and "Album Artist" field different
« Reply #4 on: September 17, 2012, 03:37:48 am »

Quote
missing "equals" added in red

Yes, I was thinking it was part of the expression, but it's not. At least it's not at all helpful to think that it is, since the expression doesn't otherwise need it. Thanks for clarifying.

I suppose a better characterization of how this works is the '=' causes {Expression} to be evaluated (in this case, to 0 or 1), and then the whole rule is an expression that evaluates to True or False. In other words, the form of the custom rule is [={Expression}]=c, which—like any condition—is either True or False.

I don't think I understood this well until I was shown how to save global variables with a rule. [=Save(value, variable)1]=1 forces the evaluation of the Save() expression, while the rule always evaluates to (1=1) True, so it has no impact on the Search.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How to create a list of "Band" and "Album Artist" field different
« Reply #5 on: September 17, 2012, 11:39:26 am »

If this helps anyone, the:

   [=  ]

can be thought of as a field specifier, just like any other [field], but the special first character being = means the field evaluator should expect and run the expression inside first, and replace the entire pseudo-field [=expr] with the output.  Then you're really left with something like:

  output=1

which fits the standard simple query syntax.

This form of amendment to an existing set of reserved characters (i.e. adding a character such as = to the opening [ character)  is fairly common in languages.
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: How to create a list of "Band" and "Album Artist" field different
« Reply #6 on: September 17, 2012, 06:32:12 pm »

Quote
If this helps anyone...

It does, thanks. Whether it's because I'm not a programmer or my brain is old and tired, I have difficulty remember such seemingly simple things. But, if I have some understanding of why it is so—even if that understanding is otherwise of little use—it seems to 'stick'. That's why I appreciate your efforts to explain how things work, rather than just providing the 'answer'. And even if I still can't regex my way out of a wet paper bag, I can still remember, "Regex!...Ask MrC."  ;D
Logged
Pages: [1]   Go Up