SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Unable to use this renaming mask.

I have different renaming masks in both songkong and jaikoz. I had to create a new one for songkong because my jaikoz one wouldn’t work. I ended up liking the new songkong one I made better, but I also can’t use it in jaikoz. Does songkong and jaikoz use different javascript interpreters or different naming conventions? Are the 2 programs naming masks not compatible with each other?

This is my songkong one:

  ifnotempty(albumartist,'/')
+ ifnotempty(album,' ')
+ (year.length>0  ? '(' + year + ') ' : '')
+  (mbreleasecountry.length>0  ? '(' + mbreleasecountry + ') ' : '')
+'/'
+ (disctotal>1 ? discno + '-' : '')
+ track + ' - '
+ title

I tried just breaking it into 2 parts to use it in jaikoz and it is not showing it working in the example mask.

Folder shows empty if I try:

  ifnotempty(albumartist,'/')
+ ifnotempty(album,' ')
+ (year.length>0  ? '(' + year + ') ' : '')
+  (mbreleasecountry.length>0  ? '(' + mbreleasecountry + ') ' : '')

File shows empty if I try:

(disctotal>1 ? discno + '-' : '')
+ track + ' - '
+ title

Any ideas why I can’t use my songkong file mask in jaikoz?

Hi its because the track number variable in SongKong is track but in Jaikoz it is trackno , I think this is really a mistake in songkong as I use discno for Disc Number in both. A little akward to change now but I’ll raise an issue for this.

Secondly in the Subfolder mask you need to define the ifempty function, its already defined in SongKong.

Simply modifying track to trackno and adding ifempty will work, Ive tested out your masks in Jaikoz.

or if trackno is not used in sk, you could define it, and list it in the help, but not pull out track in the code itself, so it doesn’t break any existing masks. Allow both variables to be used?

What would i need to define ifnotempty to? Would it need a function created first or something?

Yes I might do that.

ifempty is defined earlier in the javascript in the default Jaikoz rename mask, I created this blog post based on your question which should make things clearer

Awesome! Thank you for the write up! I will give it a try.

Just an update on the blog post. I found you need to use the folderseparator variable in jaikoz instead of the slash for it to work. So it would look like this:

function ifnotempty(value,sep){
     return value.length > 0 ? value + sep : '';
 }

    
 ifnotempty(albumartist,folderseparator)
 + ifnotempty(album,' ')
 + (year.length>0  ? '(' + year + ') ' : '')
 +  (mbreleasecountry.length>0  ? '(' + mbreleasecountry + ') ' : '')

Ah, okay thanks perhaps ‘/’ only works on OSX