Music Renaming
-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Music Renaming
My Music is sorted in such a way that when is it a single disc album it is not stored in a cd number folder but if it is a multi disc album then it is stored in CD number folders.
Single Disc: Music\Kiss\Love Gun\01 - Love Gun.mp3
Multi Disc: Music\Kiss\Love Gun\CD 01\01 - Love Gun.mp3
I am currently using two separate presets to sort my music, however i would like to find a way to use only 1 preset that sorts the music so that if the album is a single disc then it renames it to the single disc path above and if it is a multi disc album then is renames it to the multi disc path as above.
Any Help would be appreciated.
Single Disc: Music\Kiss\Love Gun\01 - Love Gun.mp3
Multi Disc: Music\Kiss\Love Gun\CD 01\01 - Love Gun.mp3
I am currently using two separate presets to sort my music, however i would like to find a way to use only 1 preset that sorts the music so that if the album is a single disc then it renames it to the single disc path above and if it is a multi disc album then is renames it to the multi disc path as above.
Any Help would be appreciated.
Re: Music Renaming
Yes, you can use if-then-else expression for that.
What formats are you currently using for these two use cases?
What formats are you currently using for these two use cases?
-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
These are the Formats That i am currently Using.
Single Disc: \Music\{n}\[{y}] - {album}\{pi.pad(2)} - {t}
Multi Disc: \Music\{n}\[{y}] - {album}\CD {media.'part/position'}\{pi.pad(2)} - {t}
Single Disc: \Music\{n}\[{y}] - {album}\{pi.pad(2)} - {t}
Multi Disc: \Music\{n}\[{y}] - {album}\CD {media.'part/position'}\{pi.pad(2)} - {t}
Re: Music Renaming
Is there any way to know if the album is a single disc? Is there {media} binding that could tell us the number of CDs?
Re: Music Renaming
Something like this might work:
The {model} binding allow you to access all matches, and then check if any of the other matches that belong to the same album have a media.Part value of 2 or higher.
This is is a bit tricky though. May or may not be possible depending on how you do things.
Code: Select all
{if (model.findAll{ it.album == album }.media.Part.any{ it.toInteger() > 1 }) 'CD'+media.Part}
This is is a bit tricky though. May or may not be possible depending on how you do things.
-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
Doesnt work. says Binding "model" : java.lang.NullPointerException.
Re: Music Renaming
Yeah, might not work on some files, depending on what you load into FileBot and what tags are set.
If you can make some test data available via Google Drive, then I could look into smoothing out the corner cases.
If you can make some test data available via Google Drive, then I could look into smoothing out the corner cases.
-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming

Sorry, the metadata in those files don't make it possible to guess which might be CD1 and which might be CD2:
Code: Select all
Title Heart Of Chrome
Album Revenge
Part/Position 01\02
Track Heart Of Chrome
Track/Position 07
Code: Select all
Title Black Diamond
Album Box Set
Part/Position 01\05
Track Black Diamond
Track/Position 14

I see these properties though, which might be useful for guess which CD files belong to? Doesn't help me find CD 1/2 but might allow me to guess which files belong to the same CD group, assuming DISCID is actually the same for all files belonging to the same CD.
Code: Select all
DISCID AF0B800C
Code: Select all
DISCID 25127A15
-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
so there is no way of doing what i want to do?
Re: Music Renaming
EDIT: I've edited my posted above. Please re-read.
But you somehow know which files go on which CD right? How do you know?
But you somehow know which files go on which CD right? How do you know?
-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
When I tag the MP3 Files I input the disc number into the ID3 Tags, so that's how i know which files go on which CD. There is obviously no way to do what i want the program to do so i will just keep using the 2 separate presets. thanks for your help.
Re: Music Renaming
Well, if the files are tagged, then it'll work. But as far as I can tell, the sample files you gave me are not tagged with CD1 / CD2 in any ID3 field that I can see.
So you're saying one of these fields somehow tells you it's CD1 / CD2? Or is there a tag that normal id3 tagging tools somehow can't read?
Code: Select all
$ id3info '07 - Heart Of Chrome.mp3'
*** Tag information for 07 - Heart Of Chrome.mp3
=== TIT2 (Title/songname/content description): Heart Of Chrome
=== TALB (Album/Movie/Show title): Revenge
=== TCON (Content type): Hard Rock
=== TPE1 (Lead performer(s)/Soloist(s)): Kiss
=== TPOS (Part of a set): 01\02
=== TRCK (Track number/Position in set): 07
=== TYER (Year): 1992
=== TXXX (User defined text information): (DISCID): AF0B800C
=== COMM (Comments): ()[eng]:
=== USLT (Unsynchronized lyric/text transcription): ()[eng]: You better listen up
...
=== APIC (Attached picture): ()[, 3]: image/jpeg, 123162 bytes
*** mp3 info
MPEG1/layer III
Bitrate: 320KBps
Frequency: 44KHz

-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
this is what my id3 tag software looks like when tagging an MP3
https://drive.google.com/open?id=1HBxTh ... K1mB9hleZ8
https://drive.google.com/open?id=1HBxTh ... K1mB9hleZ8
Re: Music Renaming
Can you confirm that it says Disk # 02 in your ID3 Editor for the second file?
07 - Heart Of Chrome.mp3 The only thing that says 01 is the first half of TPOS:
14 - Black Diamond.mp3 But it's also 01 in the second sample file you posted:
That's the only two files I got from you, so I assume that one of them is CD1 and one is CD2.
07 - Heart Of Chrome.mp3 The only thing that says 01 is the first half of TPOS:
Code: Select all
TPOS (Part of a set): 01\02
Code: Select all
TPOS (Part of a set): 01\05
That's the only two files I got from you, so I assume that one of them is CD1 and one is CD2.

-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
they are both cd 1 as they are from different albums. i dont think the problem is with the files.
Re: Music Renaming
I see, so the ID3 tags do tell us which file is which CD# number and total number of CDs.
If you tag your Disk # value like so:
Then this will work:
The key is to take the PartPosition value, e.g. 01/01 (read Disk 1 of 1) or 01/02 (read Disk 1 of 2), and then just grab the first number, if the second number is 02 or 03 ... or 09:
This code won't work for 01/10 (read Disk 1 of 10) though.
e.g. 07 - Heart Of Chrome.mp3 (Disk 1 of 2)
e.g. 14 - Black Diamond.mp3 (Disk 1 of 5)
Since your example data does not contain a test case for Disk 1 of 1, I have not included one here, but it should work.
If you tag your Disk # value like so:
Code: Select all
Disk Number/Total Number of Disks
Code: Select all
01/02
Code: Select all
X:/Music/{n}/[{y}] - {album}{'/CD ' + media.PartPosition.match(/([0-9][0-9]).0[2-9]/)}/{pi.pad(2)} - {t}
Code: Select all
media.PartPosition.match(/([0-9][0-9]).0[2-9]/)

e.g. 07 - Heart Of Chrome.mp3 (Disk 1 of 2)
Code: Select all
X:/Music/Kiss/[1992] - Revenge/CD 01/07 - Heart Of Chrome
Code: Select all
X:/Music/Kiss/[2001] - Box Set/CD 01/14 - Black Diamond

-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
that doesnt work as if the album is single disk then i dont want the files to be stored in a CD 01 folder.
Re: Music Renaming
Yes, it'll work. (assuming files are tagged correctly as described above as given in your example files)
If it's a single disk, then media.PartPosition will be 01/01 which does not match the pattern ([0-9][0-9]).0[2-9] which means the whole {'/CD ' + ...} expression will have no value (no "/CD" either), resulting in there not being a CD1/2/3 folder.

-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
In this particular case, do you want the CD1/2/3 folder?
If you don't want the CD1/2/3 folder, then it's already working.
If you do want the CD1/2/3 folder, then you first need to tag the file correctly. Because the media.PartPosition variable should say something like 01/03 (Disk 1 out of 3) and not 03 (What does 03 mean? Disk 3 out of IDK? Disk IDK out of 3?).
If you don't want the CD1/2/3 folder, then it's already working.
If you do want the CD1/2/3 folder, then you first need to tag the file correctly. Because the media.PartPosition variable should say something like 01/03 (Disk 1 out of 3) and not 03 (What does 03 mean? Disk 3 out of IDK? Disk IDK out of 3?).
-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
this is what ended up working.
Code: Select all
\Music\{n}\[{y}] - {album}{media.'part/position_total' == null ? null : '/CD ' + media.'part/position'}\{pi.pad(2)} - {t}
-
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
is there a way to just get the year and month the album was released instead of the entire date?
Re: Music Renaming
Yes, if that information in the tags. What {variable} are you using to get the entire date?
Unfortunately, the sample files you gave me only contains the release year information, so it may not be possible for many of your files:
Unfortunately, the sample files you gave me only contains the release year information, so it may not be possible for many of your files:
Code: Select all
=== TYER (Year): 1992