Skip to main content
Topic: Syntax: Return value in list unless it matches specified value?  (Read 79 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Syntax: Return value in list unless it matches specified value?

Hi all, I'm wondering if this can be done in foobar2000, I'm assuming it can given that the syntax is quite powerful but I haven't been able to figure it out.

I use Facets and want to create a column query that returns a list of values except for when it matches a specified value (or multiple specified values).

That might sound confusing so I'll give some examples:

1. I have a label tag and want a list of labels, so I currently have [%label%]. However, I don't want it to show the tag Self-Released in the list, the same way it won't show results with no label set.

2. I have a genre column ([%genre%]) and want to exclude certain general genres from the list. So I might not want to show, as an example, Spoken Word or Interview.

I'm hoping there's a syntax that can do this by the column. I know I could use filters in the case of Facets but I'm assuming there's a syntax that can do it which would be my preferred solution.

I have a hunch that something involving $if($strstr... might work just from that string being used in a theme I use.

Re: Syntax: Return value in list unless it matches specified value?

Reply #1
Answer from IRC for Case 1:
Code: [Select]
$if($stricmp(%label%,Self-Released),,[%label%])
Answer from IRC for Case 2:
Code: [Select]
[$if($strstr(;spoken word;interview;,;$lower(%genre%);),,%<genre>%)]

 
SimplePortal 1.0.0 RC1 © 2008-2019