INTERACT FORUM

More => Old Versions => Media Center 13 (Development Ended) => Topic started by: strebormj on February 07, 2009, 08:58:17 am

Title: Smartlist syntax - AND/OR
Post by: strebormj on February 07, 2009, 08:58:17 am
I have tracks with myriad Genre values like "Alt Rock," "Alternative Rock," "New Rock," "Nu Rock," etc., that I would like to include in a smartlist.   There doesn't seem to be a way to OR together values of a [Genre] [Contains] rule, and there doesn't appear to be a guide on how to use a contains-type function in a [Custom] rule. 

What's the best way to implement < Genre.Contains("rock") || Genre.Contains("alt") >?

Thanks
Title: Re: Smartlist syntax - AND/OR
Post by: mark_h on February 07, 2009, 09:14:42 am
([Genre]="alt" or [Genre]="rock")

??

http://yabb.jriver.com/interact/index.php?topic=46456.msg318347#msg318347

Mark
Title: Re: Smartlist syntax - AND/OR
Post by: strebormj on February 07, 2009, 12:24:06 pm
([Genre]="alt" or [Genre]="rock")

??

http://yabb.jriver.com/interact/index.php?topic=46456.msg318347#msg318347

Mark


Your example matches complete strings, not substrings, correct?  I'm looking to match substrings, which means either using wildcards or contains() I think.

Thanks for the link to the page on grouping rules, however. 
Title: Re: Smartlist syntax - AND/OR
Post by: strebormj on February 07, 2009, 12:41:03 pm
It looks like

Custom (
Genre contains "alt"
Genre contains "rock"
Custom )


might be the way to do it, although after doing that, the dialog seems to screw up the paren and bracket symbols.  Doing what I did above results in the grouping being lost and the logic being switched to (Genre.Contains("rock") AND Genre.Contains("alt")).

Title: Re: Smartlist syntax - AND/OR
Post by: mark_h on February 07, 2009, 01:12:27 pm
My example should match substrings... 

Mark
Title: Re: Smartlist syntax - AND/OR
Post by: strebormj on February 07, 2009, 01:44:35 pm
My example should match substrings... 

Mark


Hmm.  That does work.  When I close the dialog and reopen it, it creates the grouping correctly.


Thanks for the tip.

Do you know how to handle negation (e.g., ([Genre]="alt" or [Genre]="rock" AND [Genre]<>"classic")?  Apparently it's not "!=" or "<>" or "!([Genre]=...").
Title: Re: Smartlist syntax - AND/OR
Post by: mark_h on February 07, 2009, 04:26:35 pm
To negate, put a - in front of the expression, eg

-[genre]="rock"

will show all genres that do not contain "rock"

Mark
Title: Re: Smartlist syntax - AND/OR
Post by: strebormj on February 07, 2009, 05:27:23 pm
Thanks again, Mark.
Title: Re: Smartlist syntax - AND/OR
Post by: mark_h on February 08, 2009, 02:50:53 am
You should try using the Wizard to create expressions, it's much easier to begin with.  You can then see the text version by clicking on import/export in the wizard.

To access the wizard in the search field, click the down arrow.

Cheers,

Mark