
The statement is used to attempt to establish a mapping between the track metadata returned by a Discogs Metadata for Release or MusicBrainz Metadata for Release statement and the current set of files. If the metadata was downloaded as a key-value list you must specify the named variable which contains the metadata. If the metadata was downloaded as a container, you must specify the name of the container.
You establish the same criteria as in the Discogs or MusicBrainz wizards. You can specify the source of the file based metadata used for mapping in one of three ways:
track number title
track number - title
track number . title
You can also choose to use a tracks's duration to assist in the mapping.
The Title Truncation pattern can be used to remove the tail of a Title field. If you are placing featuring information on Title fields, the artist information can hinder matching against titles in the online metadata. For example if you use Feat. as the start of your featuring specifications, you would specify Feat. in the Title Truncation field.
A percentage score of a match is evaluated based on a fuzzy comparison between the downloaded metadata title and:
A track variable is specified to receive the result of a mapping. The index is a 0 based index into the Track List item in the extracted metadata. If not mapped the variable will be set to -1.
A track variable is specified to receive the score. A value of 0 through 100 is returned. If not mapped the variable will be set to 0. The score is entirely based on Title.
If the metadata cannot be parsed or if a required template cannot be found, the action test state will be set to false. Otherwise, it will be set to true.
Escape sequences described in Escape Sequences can be used in any text field.
The statement is not valid during grouped execution.
A few items to think about:
Here's a code snippet in a simplistic example as to how to extract the metadata:
Discogs Metadata for Release "123456" to named variable 'test'
Map Metadata to Files metadata(metadata), mode(Tag Embedded Metadata), index(V0), score(V1), Use(Title, Artist, Track, Disc, Duration)
Set named variable 'Track Info' to the value of case insensitive key 'Track List' in the list in named variable 'metadata' (delimiter "⏎" separator "≔")
Test if the numeric value of the Variable 0 field >= 0 (Set result and Variable 15)
Ignore files where Variable 15 is false
if true
Run inline action 'Extract additional per track metadata' grouped
Restore Initial Set of Files
endif
Start Extract additional per track metadata
Set named variable 'Per Track Info' to the item at index '\v0' of the list in named variable 'Track Info' delimiter "\,"
' Extract per track metadata from the key-value list in Per Track Info
' ...
Set named variable 'Extracted Title' to the value of case insensitive key 'Title' in the list in named variable 'Per Track Info' (delimiter "\:" separator "≔")
Set the Title field to "\<Extracted Title>"
If for any reason you are manually constructing the metadata the only required field is the Track list array. Each Track list item must contain the following items: Artist, Title, Track number, Disc number and Length. If you are constructing a container the numeric fields can be Numbers or Strings.