INTERACT FORUM

Windows => JRiver Media Center 32 for Windows => Topic started by: MarkCoutinho on March 24, 2024, 11:51:24 am

Title: Smartlist: how can I exclude some values?
Post by: MarkCoutinho on March 24, 2024, 11:51:24 am
Hi all,

I want to make a smartlist which gives me the titles of songs which have a colour in its name. Something like name=blue, red, green etc.
However: I don't want to get titles with for instance blueS in it. Or redDISH. And probably there are dozens of other examples which I don't want to have in it.

How can I make my smartlist so it will only give me songs with these colours in it?

Thanks!
Title: Re: Smartlist: how can I exclude some values?
Post by: JJD on March 26, 2024, 11:38:46 am
I think this example will get you close to what you are looking for. You'll have to tailor it to your needs.

The 1st Custom statement returns all songs with the words blue or red (case insensitive) in the name field. To make it case sensitive, change the 10 to 9. (See https://wiki.jriver.com/index.php/Test_and_Comparison_Functions#IsEqual (https://wiki.jriver.com/index.php/Test_and_Comparison_Functions#IsEqual) for a description of the mode values.)

[=isequal([name], blue ; red,10)]=1

The 2nd Custom statement filters out the returned name formats that you don't want (eg, in this example REmastered; FRreddIE; credIT; COLored; DELIVered).

[=isequal([name], blues ; mastered; redd; cred; ored; ered,10)]=0

The attached screenshot shows the Smartlist with returned rows in the background.

(http://SmartlistExampleFindColors.png)
Title: Re: Smartlist: how can I exclude some values?
Post by: zybex on March 26, 2024, 12:26:50 pm
This regex matches only isolated words - add as many colors as needed separated by "|":

Code: [Select]
[=regex([name],/#\b(blue|green|red|yellow|purple|black|white|orange|pink)\b#/)]=1
Title: Re: Smartlist: how can I exclude some values?
Post by: MarkCoutinho on March 27, 2024, 09:03:29 am
Brilliant, thanks!