SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Undefined coming up in filename after using rename mask

I have something with track naming of multidisc sets that I can’t figure out–I sometimes get “undefined” in the filename where I would expect to see " - " .

image.png

This doesn’t occur with multi disc sets that are marked as greatest hits or compilations, such as a 4 disc set from Yes (YesYears) or a Three Disc Nirvana Set (With the Lights Out). If it’s a Two Disc Set of Bach Cello Suites or a Three Disc Set of Symphonies by a composer with multiple ensembles, it seems to happen frequently. A sample is in the attachment.

I checked the forum and didn’t find an exact answer, but I think that it may have something to do with my rename mask.

Here is what they are:

Primary

ifnotempty2(albumartist,artist,’/’)

  • ifnotempty(album,’/’)

  • ifmultidisc(‘Disc ’ + ifnotempty(pad(discno,2),’/’))

  • ifmultidisc(ifnotempty(pad(discno,2),’ - '))

  • ifnotempty(pad(trackno,2),’ - ')

  • title

Compilation:

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

  • ifnotempty(album,’/’)

  • ifmultidisc(‘Disc ’ + ifnotempty(pad(discno,2),’/’))

  • ifmultidisc(ifnotempty(pad(discno,2,’ - ')))

  • ifnotempty(pad(trackno,2),’ - ')

  • title

Ifmultidisc(value):

The ifmultidisc function looks to be complete:

function ifmultidisc(value) {

if(disctotal>1)

{

return value;

}

else

{

return “”;

}

}

Additionally, I do not have “Disc Number” or “Disc Total” selected in the “Never Modify These Fields” on the Format and Classical Tabs.

Does this have something to do with the returned values for Artist and Album Artist? Please let me know if you have any ideas.

Hi, I am not sure but here are a few things to think about

  1. What is Rename files based on metadata set to, are you only renaming files that have been fully matched by SongKong, or are you renaming song only matches and none matches. If the latter then seems likely sometimes all metadata required for the mask may not be available

  2. I cant see which part of

ifmultidisc(ifnotempty(pad(discno,2),’ - '))

is failing, so I suggest breaking it down into multiple parts temporarily to see exactly what is failing and also checking value of disctotal for files in question

i.e

ifmultidisc(ifnotempty(pad(discno,2),’ - ')) +
ifnotempty(pad(discno,2),’ - ') +
pad(discno,2) +
disctotal