CD number when renaming music

Any questions? Need some help?
Post Reply
Tonalian
Donor
Posts: 9
Joined: 23 Oct 2014, 22:59

CD number when renaming music

Post by Tonalian »

Hi all,

I am currently using FileBot (donated), to knock my MUSIC into shape.

Using the following:

Code: Select all

{artist}/{"$artist - $album/".replaceAll(':', ' -')}{"${pi.pad(2)}. "} {t.replaceAll(':', ' -')}

Leona Lewis/Leona Lewis - Avatar/14. I see you
Unfortunately I have the following scenarios to which I am struggling to find a solution:
I do understand I need two slightly different naming schemes.

I have:
A single folder with all tracks named as 101,102,103,104 & 201, 202,203,204 etc.
Where CD1 represents: 101,102,103,104
Where CD2 represents: 201,202,203,204 etc.
I would like to keep these in one folder, not CD1,CD2 folders.
So far my naming Scheme names tracks as 1,2,3,10,12 etc not 101,102,103,110,112

I also have structures where I have CD1, CD2 folders, I would like to convert these and place them in one folder as:
101,102,103,104 & 201,202,203,204 etc. Live the above example.

I have found out $pi don't work, I have also tried the above examples, but I don't know how to use them without getting errors like Binding Exception fn path to media not set & Binding Exception file undefined

Can anyone help me try and figure this out?
I wish I understood everything about Naming Schemes, but unfortunately, I experiment, and sometimes get things correct without fully knowing why...

Thank you in advance
User avatar
rednoah
The Source
Posts: 24017
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by rednoah »

I recommend prototyping your format in the FileBot GUI Format Editor. You can also use it to see full MediaInfo data which.

Note that "AcoustID" may not always identify sets of files the way you'd expect. It's doing it file by file. You may want to use "ID3 Tags" for more predictable processing, but that'll only work if there's already ID3 tags.

If you're using AcoustID and if you're really lucky than this might work:

Code: Select all

{music.medium}
What you can definitely do:
A. check advanced MediaInfo bindings (media.* or audio.*) for CD1/2 data (i.e. use existing tags if available)
B. check existing file path and match the info from there

A.
Image

B.

Code: Select all

{'101. Song'.match(/^\d+/)}

Code: Select all

{fn.match(/^\d+/)}
:idea: Please read the FAQ and How to Request Help.
Tonalian
Donor
Posts: 9
Joined: 23 Oct 2014, 22:59

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by Tonalian »

Thank you Rednoah,

I currently have fantastic results with ID3 Tags, which website database does it reference?
For some of my music, it would be great to manually check the website database.

I was unaware of the FileBot GUI Format Editor.

I will start exploring...

This might take me some time, I will post an update when I get that far.
People, you are welcome to help!

(/^\d+/)
^ assert position at start of a line
\d+ match a digit [0-9]

-------

The following Regex: ^\d\d+ would mean
\d match first digit (CD nr.)
\d+ match rest of digits from start position
This could be used for anyone wanting to create CD1,CD2,CD3 folders
Tonalian
Donor
Posts: 9
Joined: 23 Oct 2014, 22:59

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by Tonalian »

Okay, RN has inspired me
This is the working code so far:


Naming Scheme: Working

Code: Select all

{artist}/{"$artist - $album/".replaceAll(':', ' -')}{fn.match(/^\d+/)}{". "}{t.replaceAll(':', ' -')}
Source Files

Code: Select all

101-amy_winehouse-intro_stronger_than_me.mp3
201-amy_winehouse-take_the_box_(original_demo).mp3
Expected output

Code: Select all

Amy Winehouse/Amy Winehouse - Frank/101. Intro Stronger Than Me.mp3
Amy Winehouse/Amy Winehouse - Frank/201. Take The Box (Original Demo).mp3
Hope it helps someone...

I think the first part of the puzzle is solved, need to sleep, so I will come back to this later...
Last edited by Tonalian on 19 Dec 2014, 11:48, edited 2 times in total.
Tonalian
Donor
Posts: 9
Joined: 23 Oct 2014, 22:59

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by Tonalian »

Could not sleep until I solved the little blighter

Naming Scheme: Working

Code: Select all

{artist}/{"$artist - $album/".replaceAll(':', ' -')}{folder.name.match(/\d+/).upper()}{"${pi.pad(2)}. "}{t.replaceAll(':', ' -')}
Source Files

Code: Select all

CD1 (directory)
01. Sweet Harmony.mp3
CD2 (directory)
01. Loving Feeling.mp3
Expected Output:

Code: Select all

101. Sweet Harmony.mp3
201. Loving Feeling.mp3
This allows one to drag contents from CD1 or CD2 or Cd x into FileBot
The Naming Scheme converts the filename with ID3 Tag so contents are converted and can be merged into one directory
NOTE, This does not move the files into one directory yet!

Again, inspired by RN, without Filebot and RN's support, I would not have had the balls to tackle and solve the challenge to this level. GREETZ RN...


Bed time
Last edited by Tonalian on 19 Dec 2014, 12:16, edited 2 times in total.
Tonalian
Donor
Posts: 9
Joined: 23 Oct 2014, 22:59

Re: CD number when renaming music

Post by Tonalian »

If anyone gets errors similar to Binding Exception, you need to use bindings.

How?
See the post from RedNoah post on this page, the one with the great big picture.
It's quite self explanatory.

I have been using the new Naming Schemes, now they seem to work without error.
I had to tweak and tweak until I got the desired output.
Wow, FileBot is more powerful than I ever imagined!

If you haven't donated yet, it's time to reward the developer.
Just think what else can be added if he is rewarded for his efforts...
User avatar
rednoah
The Source
Posts: 24017
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CD number when renaming music

Post by rednoah »

You could share your final format so others can learn from it, or at least copy & paste. :D
:idea: Please read the FAQ and How to Request Help.
Tonalian
Donor
Posts: 9
Joined: 23 Oct 2014, 22:59

Re: CD number when renaming music

Post by Tonalian »

Cheers RN
The above posted naming schemes appear to work well
They will be kept up to date
  • Naming scheme
    Source files
    Expected output
Others should be able to follow The posts, and learn.

Great challenge, thanks for the starter tip RN.
Post Reply