SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Jaikoz Folder/File Renaming script

Hi.

I’m at this stage not familiar with writing those scripts.

This what I like to achieve - can someone help?

  • Single Album Artist - Single Disc Album

Folder Name: Album Artist - Album Title [year]
Sample: Shakira - She Wolf [2009]

File name: ALbum Artist - Track# - Song Title
Sample: Shakira - 01 - Long Time

  • Single Album Artist - Multiple Disc Album

Folder Name: Album Artist - Album Title [year] - CD#
Sample: Shakira - She Wolf [2009] - CD1

File name: same as Single Disc Album

  • Various Artist (Compilation) - Single Disc Album

Folder Name: VA - Album Title [year]
Sample: VA - Crescent City Bounce, From Blues to R&B in New Orleans [2007]

File Name: Track# - Artist - Song Title
Sample: 01 - Earl Johnson - Have You Gone Crazy

  • Various Artist(Compilation) - Multiple Disc Album

Folder Name: VA - Album Title [year] - CD#
Sample: VA - Crescent City Bounce, From Blues to R&B in New Orleans [2007] - CD1

File Name: Same as Single Disc Album

Your support is much appreciated!

Regards,

Gino

Rename Folder Mask is

 
 function substring(value,length){
      return value.length > length ? value.substring(0,length)  : value;
  }
  
 function bracketif(value){
      return value.length > 0 ? '[' + value +']' : '';
  }
 
 
 function ifmultidisc(value) {
    if(disctotal>1)
    {
       return value;
    }
    else
    {
       return "";
    }
 }
 
albumartist + ' ' + album +  ' ' + bracketif(substring(year,4)) + ifmultidisc('CD' + discno)

Rename Filename Mask is

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(artist,' - ') + ifnotempty(pad(trackno,2),' - ') + title

I assume you want track artist rather than as stated album artist, because even if single artist album they may for example duet with another artist on some tracks.

Currently a compilation can include a single artist best of compilation although I plan to change to bring in line with iTunes. So for the Compilation Rename mask masks you would not want it to automatically hard code to VA. Its looks like the logic is the same as rename mask except to replace ‘Various Artists’ with ‘VA’ for album artist, so lets just add one more function for this giving us

Folder Compilation Rename Mask

function substring(value,length){
       return value.length > length ? value.substring(0,length)  : value;
   }
   
  function bracketif(value){
       return value.length > 0 ? '[' + value +']' : '';
   }
  
  
  function ifmultidisc(value) {
     if(disctotal>1)
     {
        return value;
     }
     else
     {
        return "";
     }
  }
 
 function ifva(value)
 {
    if (value == 'Various Artists')
    {
        return 'VA';
    }
    else
    {
        return value;
    }
 }
 
 ifva(albumartist) + ' ' + album +  ' ' + bracketif(substring(year,4)) + ifmultidisc('CD' + discno)

and the File Compilation Rename mask is then same as File rename mask, or do you really want one set of files to albumArtist - TrackNo and the other half TrackNo - Artist.

I think if you study this it should be quite self explanatory what is going on.

Hi Paul, thanks for your swift reply.
I’ll go with your code and thanks for implementing this Various Artist vs. ‘Best of’ album.
I don’t know what the best mask is regarding file naming single artist albums vs compilation albums. I’m actually fine with allbumArtist - Track# for single Artist albums and Track# - Artist for compilations.
Again, thanks for pointing me out the right direction.
Regards,

Gino