SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Renaming Files and Folders

Hi,

used Songcong to tag the majority of my collection, now want to correct the remainig files with Jaicoz.

Wanted Folder Structure:

ArtistOrAlbumartist\Album (Year)\TrackNo - Title

In Soncong I managed (after some trying) the following:

Rename Mask:

ifnotempty2(albumartist,artist,’/’)

  • ifnotempty(album,’ ')
  • ‘(’ + (year.length>4 ? year.substring(0,4):year) +’)/’
  • ifnotempty(pad(track,2),’ - ')
  • title

Compilation Rename Mask:

ifnotempty2(albumartist,“Various Artists”,’/’)

  • ifnotempty(album,’ ')
  • ‘(’ + (year.length>4 ? year.substring(0,4):year) +’)/’
  • ifnotempty(pad(track,2),’ - ')
  • title

How do I set up Jaicoz to rename Files & Folders accordingly? Pasting the above to Jaicoz Preferences doesn’t seem to work…

Thanks for any help!

There a few differences, please see http://blog.jthink.net/2014/04/sharing-filename-masks-between-songkong.html

Dear Paul,

thanks for the Link, but as I have no Javascript knowledge, I still can’t figure out how to bring Jaicoz to rename Folders & Files like Songcong…

Therefore, I’m asking the huge favor, could you (or anyone else here) pls translate above Songcong Script to Jaicoz?

I pasted the Script in the Link to Jaicoz for testing, but as I click on “Correct Sub Folders from Metadata” nothing really happens, I don’t get a new folder…

Sorry for being such a noob :wink:

thanks!

Sorry for the delay in replaying Ive just been very busy with the new SongKong release. Okay this is what you need for the subfolder rename mask

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:'' ;
 }

 ifnotempty2(albumartist,artist,'/')
+ ifnotempty(album,' ')
+ '(' + (year.length>4 ? year.substring(0,4):year) +')' + '/'

The Compilation Sub Folder Rename 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:'' ;
 }

ifnotempty2(albumartist,"Various Artists",'/')
+ ifnotempty(album,' ')
+ '(' + (year.length>4 ? year.substring(0,4):year) +')/' 

and in both cases this is what you need for the Filename mask

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

As you can see SongKong is easier because you can share existing javascript functions.