SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

File naming from Musicbrainz

First, hi everyone. This is my first post so be gentle. Unbelievable the amount of parameters to be set. So I processed a few files and have a question. Is it possible to refer to the file naming script that’s defined in Musicbrainz? My script is somewhat unique though I got it from the forums online. If it’s not possible to refer to the script is there a way to translate the script into the Jaikoz software?

I’m not talking about the Tagger scripts in Musicbrainz. I’m talking about the “name files like this” section under the options “file naming.” I can put the script in this forum if someone can help me translate it unless I can refer to it directly in Musicbrainz.

Thanks again,
Paul

You can’t use the Musicbrainz syntax but if you post your file naming mask Im sure we can convert it for you

Thanks Paul. That’s really kind of you to have someone offer to translate it.

Script and sample output are attached.

Another Paul

:stuck_out_tongue:

Reformatted so can see mask in post, it is rather complicated so I’ll have a look tonight

$firstalphachar(
   $if(
\t$eq($left($lower(%artist%),4),the ),
\t\t$right($upper(%artist%), $sub($len(%artist%),4)),
\t$upper(%artist%)
   ))/

$if(
\t$eq($left($lower(%artist%),4),the ),
\t\t$right(%artist%, $sub($len(%artist%),4))\\, The,
\t%artist%
)/

$if(%date%,$left(%date%,4) - )%album%/

%artist% - %album% - $if($gt(%totaldiscs%,1),Disk %discnumber% - ,)$num(%tracknumber%,2) - %title%

Hi

Sorry for the delay I’ve no knowledge of the Picard naming syntax but Ive done most of it for you.

In Jaikoz the mask for the folders is separate to the mask for the filename so in Preferences:File and Folder Correct:Rename Folder from Metadata put:

(year.length>0 ? year.substring(0,4)+'-':'') +
album +'/'

whats missing is the isAlphachar bit I didnt understand what you were trying to do.

and in Rename Filename from Metadata put

function pad(number, length) {
   
    var str = '' + number;
    while (str.length < length) {
        str = '0' + str;
    }
    return str;
}

artist +'-' + album + '-' + (disctotal > 1 ? 'Disk' + discno+'-':'') + pad(trackno,2) + '-' + title

Hey Paul,

Thank you so much!

Paul S.

Note,

You should really use folderseparator not ‘/’ in folder mask
Definitently have to use it if on Windows

Paul,

Just ran it on my Windows machine and worked great. Put the - instead of the slash. maybe Windows just does this on its own? Whatever I’m a happy camper. Thanks again for your help.

PS - the # was just a primary folder designation that came from a MusicBrainz environment variable to separate everything that Musicbrainz cleaned from the rest of my stuff. You are correct, totally unnecessary.

In case anyone is interested in all the variables for Musicbrainz 1.0, here you go:

http://musicbrainz.org/doc/MusicBrainz_Picard/Documentation/Scripting

Thanks,

Paul S.

Hello all! I am new here. Love the site. I have been trying to use MusicBrainz for this process, but read yesterday that Jaikoz may be a better route for my Singles Processing.

I have spent the past month organizing 40,000+ songs. Extremely messed up tags, titles and folders. 1000s of duplicates and different formats. So I have done my time in learning what NOT to do. I have read everything on the MusicBrainz website and anything else I could find on the internet on how to rip and tag music and scripting. I have studied everyone’s methods of keeping organized and I have finally decided on the following formats for myself:

STANDARD ALBUM:
\MUSIC\Deep Purple\[1965] Smoke on the Water\01 Smoke on the Water.mp3
AlbumArtist\[Year] Album Disc#\Tract# Title.mp3

VARIOUS ARTIST ALBUM:
\MUSIC\VA\[1985] Forest Gump Soundtrack Disc 1\1-01 Hound Dog - Elvis Presley.mp3
Year Album Disc#\Disc#-Tract# Title - TrackArtist.mp3

STANDARD & VARIOUS ARTIST SINGLES: (3000 individual songs organized into one folder)
\MUSIC\SINGLES\Deep Purple - Smoke on the Water.mp3
TrackArtist - Title.mp3

I know that I do NOT want “THE” in the Artist Folders/Titles. I also do not want all the strange characters or underscores, preferring to keep it neat and simple. And I would like to keep the Compilation CDs together.

The following script removes “THE”. It tested perfect for me. I am using MB Picard V1. (I need to incorporate AlbumArtist in there, too!!)

$left($if2($rreplace(%artist%,\(^The\) \(.\),\\2)),1)/$if2($rreplace(%artist%,\(^The\) \(.\),\\2)) - $left(%date%,4) %album%/$rreplace(%artist%,\(^The\)\(.*\),\\2) - $num(%tracknumber%,2) %title%

But for the life of me, I do not know how to combine this script with the scripts to do the rest of what I am wanting to do. If someone could assist me with this, I would be forever grateful. My plan is to run the scripts, have Picard/Jaikoz move, create and rename into another directory, which I have set under MUSIC\Newly Tagged. So that I can keep track of what has been tagged and what hasn’t.

If you have any suggestions or opinions as to my approach, please share. I would like to do this once, and correctly. This is a wonderful, powerful product and I am so thankful for the people who are working so hard on this fabulous project. The world needs consistency and attention to details !! THANK YOU ALL!!

ps … if you are really in for a challenge, I would love to create folders off of the SINGLES directory. ie 1940, 1950, 1960, 1970 etc … to have the individual songs put into them based on OriginalYear. I couldn’t decide whether to have the [Year] in the first position of the SINGLE song title, so they could be easily sorted via that method within the folder, or just sorted by the artist. If not, I will just do this manually. Again, thank you so very much for any and all assistance and suggestions!!

So are you looking to move to Jaikoz because the syntax for renaming/moving files in Jaikoz is different to that of Picard

See this post http://jaikoz.blogspot.co.uk/2012/08/introducing-functions-in-rename-masks.html for overview

I would move to Jaikoz if I knew I could get it to do the processes I had described. Thank you for the link. A “Results View” of the listed scripts would be nice to see, for a non-programmer user. Thank you for your time and consideration.

Yes you can do basically this, but you may have to adjust what Ive done a little to get exactly what you want.

In Jaikoz the existing path of a file is split into:

Base Folder
Sub Folder
Filename

these are all displayable columns in the main edit table.

In Jaikoz the mask is split between folders and filename, and between standard and compilation albums. Only the sub folder portion is modified the base folder part of a filename is left untouched so in the following masks it is assumed the base folder of all your files is set to \MUSIC. If it is not you can adjust already loaded files using Action:File and Folder Correct:Shift SubFolder to BaseFolder or modify how a file path is split between BaseFolder and SubFolder before loading using Preferences:General:Base Folder

The only problematic part is the special processing for Singles, we can say do special processing if the Release Type = ‘Single’ but we can’t say do special processing if the song is in the SINGLES folder because the basefolder, subfolder and filename fields are not accessible in rename masks. It depends if you want this special processing only for one song singles or if you want to do this when you have both/all songs of a single. However if you only want singles processing for a particular folder you get round this by manually changing the folder and compilation folder masks when processing the SINGLES folder only.

Folder Mask

function removeThe(value)
{
      value=value.replace('the','')
      return  value.replace('The','')
}

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(removeThe(albumartist),removeThe(artist),folderseparator) + (year.length>0 ?'[' + year + ']':'') +  ifnotempty(removeThe(album),folderseparator)  + (disctotal > 1 ? discno: + folderseparator,'') +trackno  

Filename Mask

function removeThe(value)
{
      value=value.replace('the','')
      return  value.replace('The','')
}

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

Compilation Folder Mask

function removeThe(value)
{
      value=value.replace('the','')
      return  value.replace('The','')
}

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:'' ;
 }
 
  'VA' + folderseparator +  +ifnotempty2(removeThe(albumartist),removeThe(artist),'/') + ifnotempty(removeThe(album),'/') + (disctotal>1 ? discno  + '/' : '')

Compilation Filename Mask


function removeThe(value)
{
      return  value.toLowerCase().replace('the','')
}

function pad(number, length) {
      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:'' ;
 }
 

ifnotempty(pad(discno,2),' - ') +  ifnotempty(pad(trackno,2),' - ') + ifnotempty(removeThe(title),' - ') + ifnotempty(removeThe(artist),' ')

To replace accented characters ectera enable Preferences:File and Folder Correct:File and Folder Naming:Replace non-Ascii Characters

Good point I’ll modify the blog post

Would be nice to do Advanced ( programing filenaming ) or just simple for us, normal users :slight_smile: Or some simple2advanced translator :slight_smile:

Hi, yes you’ve asked this before, I think Im working towards eomthing like this.

Consider the old format for a very simple rename mask

becomes

Now I accept the old mask is slightly simpler, but not massively so, and I think with the introduction of functions it is much easier to keep the syntax simple whilst doing somthing more complex

i.e.

The difficulty for non (Javascript) programmers is writing these functions so the plan is to provide lots of predefined functions. So for example functions like ifnotempty, ifnotempty2 and pad will be already available and wont have to be included in your mask.

Secondly, there will be a way to add new functions that are then accessible to all your rename masks.

Thirdly, you will able to store multiple rename masks, and each mask will have a name so a mask containing

could simple be called: