SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Stumped with folder renaming mask

Running into errors using this:

+ (custom1.length>0 ? custom1 + '-' :'') + (album.length>0 ? album + ' [' :'') + (year.length>0 ? year + '-' : '')
+ (custom2='HD' ? custom2 + '-' :'') + (label.length>0 ? label + '-' :'') + (catalogno.length>0 ? catalogno + ']' :'') + folderseparator

I end up with:
EnglishSongs-DB-Custom11980.06.01-The Essential Aerosmith [2002-EnglishSongs-DB-Custom2HD-Columbia-88697 92210 2]

How can I get this:
1980.06.01-The Essential Aerosmith [2002-HD-Columbia-88697 92210 2]

Should be conditional on having both custom fields populated. If the custom fields are blank, statements should be ignored.

Thanks

Hi, okay for ID3 formats (mp3, wav & aiff) Jaikoz custom1-5 field use the COMM (Comment) frame for ID3 and the COMM frame additionally contains a language and a Description field.

Unfortunately there is a bug that the rename mask is outputting the language and description rather than just the comment itself, I’ve raises issue in bugtracker.

The workaround is to make use of Javascripts find and replace on the value returned by comments

e.g

(albumartist.length>0  ? albumartist + folderseparator :(artist.length>0 ? artist + folderseparator : '')) 
 + (custom1.replace('English','').replace('Songs-DB-Custom1','').length>0 ? custom1.replace('English','').replace('Songs-DB-Custom1','') + '-' :'')
 + (album.length>0 ? album + ' [' :'') + (year.length>0 ? year + '-' : '')
 + (custom2.replace('English','').replace('Songs-DB-Custom2','')='HD' ? custom2.replace('English','').replace('Songs-DB-Custom2','') + '-' :'') 
+ (label.length>0 ? label + '-' :'') + (catalogno.length>0 ? catalogno + ']' :'') + folderseparator

Hello, There must be an error in there somewhere as it’s not letting me save. Nothing stands out however. Thanks

NVM, i adjusted my logic and it seems to work:

  + (custom1.replace('English','').replace('Songs-DB-Custom1','').length>0 ? custom1.replace('English','').replace('Songs-DB-Custom1','') + '-' :'')
  + (album.length>0 ? album + ' [' :'') + (year.length>0 ? year + '-' : '')
  + (custom2.replace('English','').replace('Songs-DB-Custom2','').length>0 ? custom2.replace('English','').replace('Songs-DB-Custom2','') + '-' :'') 
 + (label.length>0 ? label + '-' :'') + (catalogno.length>0 ? catalogno + ']' :'') + folderseparator

Thanks Paul! Now I gotta figure out how to name the files

Great, sorry about the typo.

Uh oh. For some reason I’m running into similar issue with tagging DSF files. Using this code I’m now getting a folder of:

Undercover [1983- -Songs-DB Custom2 -HD-Universal-UICY-40072]

It seemed to work before but now, not so much. Any thoughts?

Well DSF uses ID3 same as Wav, Aiff and MP3s so is subject to the same issue, please check if your mask still works with the files it was working with

Mask still works on flac files as before

It would work on Flac, but the mods were not for Flac since Flac does not use ID3, the original issue must have been for non Flac files ?

The original issue was impacting flacs as well. The solution resolved for all formats up until I edited it to add a 3rd custom field. The 3rd field brought the original issue back, so I removed the new line, but the issue remained. I will send the entire code I am trying to get to work, maybe that will help or maybe there is a better mask altogether. Thanks Paul!

PersonalMax=190;
 Fills=12; //2 slash's, 6 for year, 3 for seperation of artist/album
 (albumartist.length>0 ? WhichArtist = albumartist : (artist.length>0 ? WhichArtist = artist : WhichArtist = 'noartist'));
 (artist.length>0 ? RWhichArtist = artist : (albumartist.length>0 ? RWhichArtist = albumartist : RWhichArtist = 'noartist'));
 PreTitle=RWhichArtist.length + WhichArtist.length + album.length + Fills;
 ForFileName=PersonalMax - PreTitle;
 FullSum=title.length + album.length + WhichArtist.length + 13;
 NoAlbumSum=title.length + WhichArtist.length + 10;
 TitleTrackSum=title.length + 7;
 (TitleTrackSum>ForFileName ? (
 \tWhatToCut=TitleTrackSum-ForFileName+3,
 \tNewAlbum='',
 \tNewArtist='',
 \tNewTitle=title.substring(0,(title.length-WhatToCut)) + '...'
 \t) : (
 \t\tNoAlbumSum>ForFileName ? (
 \t\tWhatToCut=NoAlbumSum-ForFileName+3,
 \t\tNewAlbum='',
 \t\tNewArtist=WhichArtist.substring(0,(WhichArtist.length-WhatToCut)) + '...',
 \t\tNewTitle=title + ' - '
 \t\t) : (
 \t\t\tFullSum>ForFileName ? (
 \t\t\tWhatToCut=FullSum-ForFileName+3,
 \t\t\tNewAlbum=album.substring(0,(album.length-WhatToCut)) + '...',
 \t\t\tNewArtist=WhichArtist + ' - ',
 \t\t\tNewTitle=title + ' - '
 \t\t\t) : (
 \t\t\t\tWhatToCut='',
 \t\t\t\tNewAlbum=album,
 \t\t\t\tNewArtist=WhichArtist + ' - ',
 \t\t\t\tNewTitle=title + ' - ')
 \t\t)
 \t)
 );

(albumartist.length>0  ? albumartist + folderseparator :(artist.length>0 ? artist + folderseparator : '')) 
 + (custom1.replace('English','').replace('Songs-DB-Custom1','').length>0 ? custom1.replace('English','').replace('Songs-DB-Custom1','') + '-' :'')
 + (album.length>0 ? album :'')
 + (' [' + (year.length>0 ? year + '-' : ''))
 + (custom2.replace('English','').replace('Songs-DB-Custom2','').length>0 ? custom2.replace('English','').replace('Songs-DB-Custom2','') + '-' :'') 
+ (custom3.replace('English','').replace('Songs-DB-Custom3','').length>0 ? custom3.replace('English','').replace('Songs-DB-Custom3','') + '-' :'') 
 + (label.length>0 ? label + '-' :'')
 + (catalogno.length>0 ? catalogno + ']' + folderseparator :'')