INTERACT FORUM

More => Old Versions => JRiver Media Center 31 for Windows => Topic started by: harpo on November 19, 2023, 11:29:03 am

Title: Need Help with Smartlist Expression Syntax Alteration
Post by: harpo on November 19, 2023, 11:29:03 am
Hello everyone,

I'm reaching out for some help with a specific issue I'm encountering in the JRiver Media Center's smartlist editor. I've crafted a couple of search expressions to create a smartlist that includes "Dub" tracks where "Techno" exists in either the Genre or Style tags, while excluding any tracks tagged as "Dubstep" in either Genre or Style. The expressions I created are as follows:

([Genre]="Dub" AND ([Genre]="Techno" OR [Style]="Techno")) OR ([Style]="Dub" AND ([Genre]="Techno" OR [Style]="Techno")) AND (-[Genre]="Dubstep") AND (-[Style]="Dubstep")
([Genre]="Dub" AND (-[Genre]="Dubstep") AND ([Genre]="Techno" OR [Style]="Techno")) OR ([Style]="Dub" AND (-[Style]="Dubstep") AND ([Genre]="Techno" OR [Style]="Techno"))

These search queries in the files view work as intended, see screenshot 1.

However, when I apply either of these expressions in the smartlist editor, the syntax seems to be automatically altered to something different, which looks like this:

([Genre]="Dub" -[Genre]="Dubstep") ([Genre]="Techno" or [Style]="Techno") ([Style]="Dub" -[Style]="Dubstep") ([Genre]="Techno" or [Style]="Techno")

see resulting Smartlist in screenshot 2 and the Smartlist editor windows in screenshot 3 and 4.

This alteration doesn't meet my requirements, and I'm struggling to understand why this change is happening and how to correct it. Does anyone have experience with this type of issue or any insights into why the smartlist editor might be altering my expressions?

Any help or guidance would be greatly appreciated. I'm using JRiver 30 on Windows, in case that's relevant.

Thank you in advance!
Title: Re: Need Help with Smartlist Expression Syntax Alteration
Post by: zybex on November 19, 2023, 12:15:02 pm
MC parses the expression and optimizes it. AND is implicit, so it gets removed. Superfluous parenthesis are also removed. The problems seems to be caused by a lack of parenthesis on your expression, so it's not clear to MC if you want the OR or the AND to take precedence. The first expression is, because of that, ambiguous. It reads like this:
    ([Genre]="Dub" AND ([Genre]="Techno" OR [Style]="Techno"))
OR  ([Style]="Dub" AND ([Genre]="Techno" OR [Style]="Techno"))
AND (-[Genre]="Dubstep")
AND (-[Style]="Dubstep")


Assuming you just want to exclude Dubstep from the results, try this (should work both on the search box and on a Smartlist):
-[Genre]="Dubstep" -[Style]="Dubstep" (([Genre]="Dub" [Style]="Techno") or ([Genre]="Techno" [Style]="Dub"))
Title: Re: Need Help with Smartlist Expression Syntax Alteration
Post by: harpo on November 19, 2023, 01:02:47 pm
Thanks for the solution approach. With your syntax the query i need is like this:
-[Genre]="Dubstep" -[Style]="Dubstep" (([Genre]="Dub" [Style]="Techno") or ([Genre]="Techno" [Style]="Dub") or ([Style]="Dub" [Style]="Techno")) or ([Genre]="Dub" [Genre]="Techno"))              
But again, in the search view it works fine but not in Smartlist mode. I suspect the problem is caused by these double references to the same tags Style and Genre:
or ([Style]="Dub" [Style]="Techno")) or ([Genre]="Dub" [Genre]="Techno"))
Title: Re: Need Help with Smartlist Expression Syntax Alteration
Post by: zybex on November 19, 2023, 01:19:20 pm
You have one too many parenthesis (marked in red), tripping MC parser:
Quote
-[Genre]="Dubstep" -[Style]="Dubstep" (([Genre]="Dub" [Style]="Techno") or ([Genre]="Techno" [Style]="Dub") or ([Style]="Dub" [Style]="Techno")) or ([Genre]="Dub" [Genre]="Techno"))

Try removing it:
Quote
-[Genre]="Dubstep" -[Style]="Dubstep" (([Genre]="Dub" [Style]="Techno") or ([Genre]="Techno" [Style]="Dub") or ([Style]="Dub" [Style]="Techno") or ([Genre]="Dub" [Genre]="Techno"))
Title: Re: Need Help with Smartlist Expression Syntax Alteration
Post by: zybex on November 19, 2023, 01:29:29 pm
This should also work :P
Code: [Select]
[=regex(replace([genre];[style],dubstep,,1),dub.+techno|techno.+dub)]=1
Title: Re: Need Help with Smartlist Expression Syntax Alteration
Post by: harpo on November 19, 2023, 01:46:05 pm
You have one too many parenthesis (marked in red), tripping MC parser:
Try removing it:

Thanks a lot that worked!