Hi. I have ZERO knowledge in Java script so I need some help please. Currently I am using the script below to rename my track files as:
Track Number - Track Title
function pad(number, length) {
if (number == '') { return '';}
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}
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:'' ;
}
ifnotempty(pad(trackno,2),' - ') + title
That works perfectly for single disc releases. What I am trying to work up is IF there is more than one disc in the release, I want to add a padded disc number before the track number. For example:
Disc Number-Track Number - Track Title
otherwise if only one disc, leave the original naming as is.
Hope you can help. Thanks in advance.