Wednesday, 29 March 2017

MinimServer with SongKong: Part 2: Sorting Composer by Sort Name

Continuing with the same dataset if we double click on the Composer index the composers are displayed alphabetically, but by FirstName rather than by LastName

It is more usual to organize people by the last name, for example consider a telephone directory, and this is the purpose of Sort Fields. A sort field isn't typically used for display but to sort the values for display.

MinimServer has a set of field names that is has mapped to logical fields that can be used for any audio format in the Tag mappings section of the User Guide. One of these is the ComposerSort field

MinimServer and Reverse Names

Whilst MinimServer can be configured to guess the sort name by reversing the values using the reverseName
option this only works for the usual Western names. Sometimes an artist
doesn't have a first name, and composers in non-latin script cannot be
handled. It is preferable to use dedicated sort fields rather than guessing the sort value by looking at the non sort field.

SongKong and Jaikoz support for Sort Fields

When we look up a person in MusicBrainz they have a dedicated sort version of their name. This means the ComposerSort field always has a value and latin script sort names are provided for all people, even if their name is in non latin script such as Cyrillic or Chinese. For example the sort name of

Пётр Ильич Чайковский

is

Tchaikovsky, Pyotr Ilyich.

MusicBrainz data is peer reviewed and therefore generally reliable.

MinimServer Configuration

We configure MinimServer as follows:

We add any fields we need MinimServer to read from the files but not index, so we add ComposerSort, case doesn't actually matter we could have added as composersort or COMPOSERSORT.

Then in tagValue a special syntax can be used to tell MinimServer to sort a value by another value, so here we tell it to sort the Composer field by the ComposerSort field using the format

DisplayField.value.sort={SortField}

i.eitemTags:ComposerSorttagValue:Composer.value.sort={ComposerSort}

Tell MinimServer to rescan and now when we view with our control point we can see the composers are now sorted correctly by their last name.

Other Sort Fields

We can use this approach for any other of people such as conductors and performers in our metadata. Luckily SongKong and Jaikoz provides the required data, for example Conductor Sort is not a standard metadata field but SongKong and Jaikoz provide it so it can be used by MinimServer, we delve into sort fields more in the next post.