Determine if Compilation

This action determines if an album is part of a compilation based on the number of different Artist fields in the album. You control how the action operates by setting the Artist threshold in a variable. The action correctly works on multiple albums at a time. Tracks with empty Album fields are ignored.

----- Start of action 'Determine if Compilation'

'

An action to determine if an album is a compilation. This determination is based on the number of unique artist fields that are found in a given album.

Set the named variable 'threshold' to the number of unique artists which are required in order to assume a compilation. 'threshold' is initialized here to 3.

Note that multiple albums are handled correctly. Tracks with empty album fields are ignored. Tracks with empty artist fields will have their 'compilation' field set but are ignored when determining the number of unique artists.

Cancel if the current execution context does not support support Stepwise

'

Initialize the threshold to 3. Change this value if you want to determine compilations based on a different number of unique artist fields.

Set named variable 'threshold' to "3"

'

Trim the Artist and Album fields to ensure that there are no leading or trailing spaces

Trim the Artist and Album fields (SP) [Leading] [Trailing]

'

Only process tracks with a non empty Album field.

Test if the Album field is not empty (Set result and Variable 3)

Run inline action 'Process Tracks With Non Empty Album Fields' if Variable 3 is true