More > JRiver Media Center 24 for Windows
expression help list of favourites and using populating calculated field
wer:
--- Quote from: lise on December 07, 2020, 08:34:59 pm ---...I tried a few a few iterations of "if is equal", but the second condition always gets filtered by the first...
--- End quote ---
lise,
I actually couldn't follow your narration of what you were trying to do with the fields, but perhaps that's not important, as I do understand your code.
Since you got as far as you did, you obviously know what you're doing and probably don't need anyone to write something for you. You're on the right track... Your problem is only one of logic, not of a code error.
You're not taking into account the case where both a AND b can be true; your code tests case a, and if that fails, it tests case b, and that's it. It never tests a&b.
Right now your code evaluates to: if A, else if B, else fail.
The expression language has an AND statement. Use that to test the a&b condition first, all in an IfElse.
So your test should look like: if (A&B) ..., else if A ... , else if B ..., else fail.
The AND case test must come first, because the first match will exit the expression, and either your case a or case b will be true in the AND case.
See what I mean?
lise:
Ah, didn't catch the "and" functionality in the wiki. I kept trying to get an (if a or b) then this, otherwise if a then this, if b then this. That's not quite what was in my example code, but it was definitely in one of my many attempts.
Thanks for the reply wer. Much appreciated.
wer:
No problem. Is that enough to sort you out?
If you wanted the "simpler" i.e. more elegant solution you asked about at the end, I could take a look at that, but in that case I would have to actually understand what you're trying to do, so I guess you'd have to explain again in a different way and maybe give an example, because you lost me with the "if it's selected in the favorites list" bit...
lise:
wer,
I modified my original post. Perhaps it is more clear what I need?
Also, I've been at it all day long and I just can't get the "and" to work. I don't dare post everything I've tried because it would be so long...
What I really need is a if contains, that way if it contains Jonnie then select Jonnie, and if it contains Lise then select Lise and that way both Lise and Jonnie get added when they are both checked and also if just one of them is checcked. But I can't seem to put that together.
lise:
I've made it even more basic:
Here's the code I need (it comes from the two bolded lines below)
If [Favourites] contains Jonnie Albums, then write Jonnie (total should be 63)
If [Favourites] contains Lise Albums, then write Lise (total should be 105)
When I do these searches in with the Wizard, here are the results
Wizard:
All Jonnie fave albums: [Favourites]=[Jonnie Albums] = 63 total Jonnie
Jonnie, not lise: [Favourites]=[Jonnie Albums] -[Favourites]=[Lise Albums] = 34 unique to Jonnie
both Jonnie and lise: +[Favourites]=[Jonnie Albums],[Lise Albums] = 29 that we both love
All Lise fave albums: [Favourites]=[Lise Albums] = 105 total Lise
Lise, not jonnie: -[Favourites]=[Jonnie Albums] [Favourites]=[Lise Albums] = 76 unique to Lise
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version