This is a minor release that mainly has fixes and improvements for the Rename Files task.
Rename Files
Every metadata field can be used in rename mask
e.g
albumartists - album - title
For the file being renamed if the field represents a field that has multiple values for that file then they will be all displayed separated by ;
e.g
Johnny Cash; June Carter
In previous versions if you wanted to get individual values you could use special index variables, and these existed for every field from zero to nine even if the field had no value for that indexed value.
e.g
albumartist_index0
albumartist_index1
…
albumartist_index9
We have now changed so that the indexed values are stored in a javascript array
e.g
albumartist_index[0]
albumartist_index[1]
and we only create an array index for a field if the field actually has a value, and the index is now the size of the number of values that we have so you can use length field of an array
e.g
albumartists_index.length
But we cannot assume the index array will even exist for a particular file so we also need to check for existence with
e.g
albumartists_index !== ‘undefined’
Rename Files:Classical Albums
Classical albums can sometimes have many people credited as album artists, rename masks usually use album artist field as part of the rename mask so this can lead to filenames that are too long. We can limit how many album artists are stored in album artist field using Maximum Album Artists allowed but if we want all album artists to be preserved in metadata this will mean that when many album artists the album artist part of filename will be too long.
We have modified the IsClassical rename masks to show a maximum of three artists from AlbumArtists field if classical album in order to avoid this issue, they now use the following Javascript function to set the album artist folder.
function addClassicalAlbumArtist()
{
if(isclassical=='1' && albumartists_index !== 'undefined' && albumartists_index.length >=3)
{
return albumartists_index[0] + '; ' + albumartists_index[1] + '; ' + albumartists_index[2]
}
else
{
return albumartist
}
}
Note existing installations will not pick up this change unless you remove your configuration folder and then SongKong will recopy files over on restart. But you can implement yourself as follows
Add addClassicalAlbumArtist() function as above, then refer to in IsClassical rename masks
e.g
addClassical()
+ addHD()
+ ifnotempty(addClassicalAlbumArtist(),'/')
+ ifnotempty(album,'/')
+ ifmultidisc('Disc ' + ifnotempty(pad(discno,2),'/'))
+ ifmultidisc(ifnotempty(pad(discno,2),' - '))
+ ifnotempty(pad(trackno,2),' - ')
+ title
For more details on rename masks please see here
Full Release Notes
Improvement
SONGKONG-2632 In Filename masks access multi value fields using index rather than separate vars e.g artists_index[1] rather than artists_index1
SONGKONG-2633 Improve Classical rename masks to better handle when have many album artists
Bug
SONGKONG-2623 In Match to One Album If Force Allow Low Scoring matches option is enabled should allow track matches out of duration
SONGKONG-2624 Help text for Use standard title is incorrect it is for use standard artist instead
SONGKONG-2630 Rename Files complaining about rename mask after a number of iterations if mask includes discno
SONGKONG-2631 Updating already matched to bandcamp album complaining because checking album.getArtist() instead of artist()