This Tip & Trick makes it possible to set a filter for a playlist or a library filter that will return the whole album if even only one track matches the filter rule.
This can be useful if you e.g. want to filter:
- albums that have one or more tracks that don't have a track gain value
- albums that have one or more tracks encoded in a low quality
- albums that have one or more tracks missing
etc.
This needs two virtual tags.
The first one is to define what tag is to be used as criterion for the filter, the second one will be used in the filter/playlist rule.
virtual tag 1 will be something like this:
$IsNull(<original tag>,,1)
virtual tag 2 will be something like this:
$If($Sum(<virtual tag 1>,<Album>)>0,yes,no)
Examples for the three above mentioned cases:
1. Does an album contain a track that has no ReplayGain value?
virtual tag 1:
- label:
trackgainmissing
- formula:
$IsNull(<Track Gain>,1,)
virtual tag 2:
- label:
albumtrackgainmissing
- formula:
$If($Sum(<trackgainmissing>,<Album>)>0,"RG missing",)
filtering/playlist rule:
albumtrackgainmissing has a value
2. Does an album contain a track that was encoded in a lower quality lossy format?
(in this example below 160Kbps)
virtual tag 1:
- label:
bitratelow
- formula:
$If($Split(<Bitrate>,k,1)<160,1,)
virtual tag 2:
- label:
bitratealbumlow
- formula:
$If($Sum(<bitratelow>,<Album>)>0,bitratealbumlow,)
filtering/playlist rule:
bitratealbumlow has a value
3. Filter incomplete albums (1)
This one needs only one virtual tag:
- label:
albumincomplete
- formula:
$If($Sub($Sum(<Tr.#>,<Album>),$Div($Mul(<Album Track Count>,$Add(<Album Track Count>,1)),2))=0,,mismatch) (2)
filtering/playlist rule:
albumincomplete has a value
(1) you could also use MusicBee's <Album Complete?> tag for filtering, but that one will only work if all your tracks have their tracknumbers written as 'track/total tracks"
(2) shout-out to Carl Friedrich Gauss for helping me with this