Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: %album artist% does not sort correctly (Read 1999 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

%album artist% does not sort correctly

Hello,

A few days ago I discovered foobar2000 as management tool for my music collection and instantly fell in love. I just found a little bug in the sorting of my Album List. I'm using the following query for sorting my music: $if2(%albumartist%|,Various artists|)$if(%album%,%album%[ '['%date%']']|,No album|)[Disc %discnumber%|][%track% ]%artist% - %title%, so VA albums and separate tracks get sorted in their own subfolder. This query actually works without any problem.
Since foobar2000 encourages the use of ALBUM ARTIST instead of ALBUMARTIST, I converted these tags from ALBUMARTIST to ALBUM ARTIST. But when I changed %albumartist% to %album artist% in my query, it doesn't sort the tracks without ALBUM ARTIST into their own folders. Does anybody have an idea what causes this strange behavior?

%album artist% does not sort correctly

Reply #1
There is a built-in remapping logic for %album artist%, so it checks all the following fields and returns the first one present: ALBUM ARTIST, ARTIST, COMPOSER, PERFORMER. See the Titleformatting help for details about this.

Anyway, here the first argument to your the $if2() is always true, even if there is no ALBUM ARTIST field. You can use $meta_test() to test a field directly without the remapping.
Full-quoting makes you scroll past the same junk over and over.

%album artist% does not sort correctly

Reply #2
%album artist% remaps itself if the ALBUM ARTIST field is missing, that is what is messing you up.
You can read more about remappings here
The reason foobar encourages the ALBUM ARTIST is to take advantage of these remappings, however, I think you appear to be using it backwards.

The intended use of ALBUM ARTIST is to remain blank, unless an album contains tracks by Various Artists, only then ALBUM ARTIST should contain a value (perhaps something like Various or Various Artist or V.A.). ALBUM ARTIST really shouldn't contain critical information, such as the actual artist name, that should go in the %artist% field instead (for compatibility with other software/hardware purposes).


If you decide you don't want to change your current usage, you can use the $meta() function to access the value of a tag while avoiding the remappings.  So in this case your sting would be:
Code: [Select]
$if2($meta(album artist)|,Various artists|)


[edit:] as per Yirkha, $meta_test() only returns a true/false value so you would use it like this:
Code: [Select]
$if($meta_test(album artist),%album artist%|,Various artists|)
My solution is a bit tidier, though.

([SERVED] )
elevatorladylevitateme