While the actual implementation is quite complex, it basically boils down to comparing the
album tag and either
albumartist or, if that’s not set,
artist. The album and artist names don’t need to be exactly the same, instead they are compared for similarity with a certain threshold.
%album% tag is not set Picard will attempt to get both album and artist from the file paths. It assumes a folder hierarchy of
%albumartist%/%album% for this.
So if you want to get proper clusters you need to make sure to have
artist set for each file or there is no album tag and your folder hierarchy works.
If tags are set, but are so inconsistent that clustering does not produce good results, Picard does not support to forcefully cluster by folder structure directly. A workaround is to use the “Tags From File Names” function (available in the main menu under tools).
In my example I have files without any tags in a folder structure like
%albumartist%/%album% and use Tags From File Names to fill the tags:
After I have applied this clustering provides proper results:
EDIT: There is also a ticket about this