SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

File renaming mask code?

Anyone know how to make this so that if album artist equals Various Artists then it will just put the song artist.

function pad(number, length) {
      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:'' ;
 }
 
 ifnotempty2(albumartist,artist,' - ') + ifnotempty(album,' - ') + ifnotempty(pad(trackno,2),' - ') + title

Hi, you shouldn’t need to do this because if album artist is Various Artists then the Is Compilation field should be set to true. If the is compilation flag is set to true then Jaikoz uses the COmpilation Rename Mask rather than the Rename Mask.

However, they dont have to match it is possible to manually edit so that the Is Compilation field set to false but the album artist is still set to Various Artists. In which case you could simply copy and modify ifnotempty2 to check the value of albumartist.

function pad(number, length) {
      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:'' ;
 }
 
function ifnotemptyorVa(value1,value2,sep){
     return value1.length > 0 && value1 != 'Various Artists'? value1 + sep :value2.length > 0 ? value2 + sep:'' ;
}
 

 ifnotemptyorVa(albumartist,artist,' - ') + ifnotempty(album,' - ') + ifnotempty(pad(trackno,2),' - ') + title


Ok thank you. I was wondering when the compilation one would be used.