I'm trying to set up some views, however $if statements are either not working or I've missed something in the documentation...
Ultimately, I want to create views for 'recently added' as well as 'new unsorted' etc., but here's a simple example of the issue I'm having:
Adding a new view with this script:
$if(%genre% HAS "Rock",%album artist%,)
..i would expect it to return all album artists which contain tagged mp3s with a genre containing Rock
However it returns all album artists which have any genre, ie. the same results as
$if(%genre%,%album artist%,)
I've tried different (needlessly complicated) approaches, but to no avail. Also tried different simple examples, all seem to do the same thing. Whenever there's a HAS or IS or whatever, it ignores it and just returns 'true' for the %variable% in the statement if on its own it would be 'true'.
What am I missing?
PS. Apologies if this is the wrong forum - Tech Support is not about 'How To' and General isn't about 'Tech Support'... Please move my post if needed.
Queries are not supported in title formatting expressions. As far as the the $if function is concerned, $if(%genre% HAS "Rock",...), $if(blah%genre%meh,...) and $if(%genre%,...) are all the same. If you want to achieve the equivalent of the %genre$ HAS Rock query inside title formatting, you have to use $if($strstr(%genre%,Rock),%album artist%).
Thank you for the quick answer.. I didn't see that in the documentation anywhere
$if($strstr(%genre%,Rock),%album artist%) works.
This is going to leave me with a headache though, for something like this (a recently added view):
$if(%last_modified% DURING LAST 2 WEEKS,%album artist%)
Yes, I know that won't work - but, you can see what I want it to do.
I didn't see that in the documentation anywhere
http://wiki.hydrogenaudio.org/index.php?ti...tting_Reference (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Title_Formatting_Reference)
A copy of which is included with the installer, alongside the document on query syntax (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Query_syntax). Both make it clear which separate contexts they function in.
Ultimately, I want to create views for 'recently added' as well as 'new unsorted' etc.
This is why autoplaylists exist. They are constructed from query syntax. An example tutorial on how to use them: http://nujufoobar.blogspot.co.uk/2013/01/h...from-media.html (http://nujufoobar.blogspot.co.uk/2013/01/how-to-create-auto-playlist-from-media.html)
P.S. Yes, General is the correct forum for questions that can be answered by other users. Support is for problems/unintended behaviour that require attention from developers.
Thanks