SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Help needed - Rename Folder from Metadata

Hello everyone, I am using Jaikoz Pro, but my java coding skills are just as good as non existing. I have been struggling trying to create a rule/code that would rename the folder structure for compilations as per two options as follows:

When it is a compilation with only one disc:

Dream Dance, Vol. 01\

for this I had:
ifnotempty(album,folderseparator)

OR (In case the compilation has more than one disc)

Dream Dance, Vol. 01\Dream Dance, Vol. 01 - Cd 1

for this I had:
ifnotempty(album,folderseparator) + ifnotempty(album," - Cd ",discno,folderseparator)

But I’ve been trying to have one string that would combine the two of them, so it would do either one or the other depending on the discno variant…

Any help would be greatly appreciated…

Thanks in advance,

-Chris

This should work

function ifnotempty(value,sep){
     return value.length > 0 ? value + sep : '';
 }
 
function ifmultidisc(value) {
   if(disctotal>1)
   {
      return value;
   }
   else
   {
      return "";
   }
}
ifnotempty(album,folderseparator) + ifmultidisc(ifnotempty(album," - Cd " + discno))

You’re legendary mate!!!
Thanks a lot, as soon as changed the value for ‘disctotal’ it worked like a charm…