Jaikoz: rename folder from metadata
/* -*-javascript*-*
* Rename folder from Metadata (Rename mask)
*/
function ifnotempty(value, sep) {
return value.length > 0 ? value + sep : '';
}
function ifnotempty2(value1, value2, sep) {
return value1.length > 0 ? value1 + sep : value2.length > 0 ? value2 + sep : '';
}
ifnotempty2(albumartist, artist, folderseparator) + ifnotempty2(albumartist, artist, ' - ') +
ifnotempty(year, ' - ') + ifnotempty(album, folderseparator) +
(disctotal > 1 ? album + ' (Disc ' + discno + ')' + folderseparator : '');