Consider this simple mask
(album.length>0 ? album + '-':'') + (trackno.length>0 ? trackno + '-':'') + (title.length>0 ? title:'')
However recently discovered there is nothing to stop you defining functions within your filename mask so the above can be replaced by
return value != undefined && value.length > 0 ? value + sep : '';
ifnotempty(album,'-')+ ifnotempty(trackno,'-') + ifnotempty(title,'')
As you can now see the complexity is put into the function once, then the resultant mask can be much more concise.