Music Renaming
-
Annihilator1243
- 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?
-
Annihilator1243
- 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.
-
Annihilator1243
- 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.
-
Annihilator1243
- 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 07Code: Select all
Title Black Diamond
Album Box Set
Part/Position 01\05
Track Black Diamond
Track/Position 14I 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 AF0B800CCode: Select all
DISCID 25127A15-
Annihilator1243
- 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?
-
Annihilator1243
- 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-
Annihilator1243
- 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\02Code: Select all
TPOS (Part of a set): 01\05That's the only two files I got from you, so I assume that one of them is CD1 and one is CD2.
-
Annihilator1243
- 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 DisksCode: Select all
01/02Code: 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 ChromeCode: Select all
X:/Music/Kiss/[2001] - Box Set/CD 01/14 - Black Diamond-
Annihilator1243
- 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.
-
Annihilator1243
- 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?).
-
Annihilator1243
- 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}-
Annihilator1243
- 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-
Annihilator1243
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
i am using {d} which shows the entire date.
Re: Music Renaming
If you're using {d} then you can get the year / month / day fields like so:
Code: Select all
{d.year}-{d.month}-
Annihilator1243
- Posts: 16
- Joined: 20 Jan 2019, 07:34
Re: Music Renaming
do you know any programs that allow you to tag the full release date?
Re: Music Renaming
In general, I can recommend MusicBrainz Picard, but I'm not sure if ID3v2 tags allow for what you're asking for specifically.
Re: Music Renaming
Hi, so I have similar issues and goals.
The goal is, if the track is part of the multi-disc album, then split the album by disc number and assign the disc number in front of the track number, except if it's a single disc album, in which case it should just not include any disc references.
For example:
Multi Disc
Single Disc
this is the code I am using:
These are the bindings:
Ideally I would like to include the album release year in Brackets after the Album Name
For example.
Please help1
This is my current output:
Thanks so much
The goal is, if the track is part of the multi-disc album, then split the album by disc number and assign the disc number in front of the track number, except if it's a single disc album, in which case it should just not include any disc references.
For example:
Multi Disc
Code: Select all
Disc 1 - 101
Disc 2 - 201Code: Select all
01this is the code I am using:
Format: Select all
F:\AA/[{y}]{album+'/'}{n}\ - {album}{media.'part/position_total' == null ? null : '/CD ' + media.'part/position'}\{pi.pad(2)} - {t}
Properties: Select all
# MediaInfoLib - v22.12
[General]
Count : 343
StreamCount : 1
StreamKind : General
StreamKind/String : General
StreamKindID : 0
AudioCount : 1
Audio_Format_List : FLAC
Audio_Format_WithHint_List : FLAC
Audio_Codec_List : FLAC
CompleteName : F:\ACDC\FLAC\Are You Ready - The Very Best Of AC DC\Are You Ready - The Very Best Of AC DC [Disc 1]\08 - Baptism by Fire.flac
FolderName : F:\ACDC\FLAC\Are You Ready - The Very Best Of AC DC\Are You Ready - The Very Best Of AC DC [Disc 1]
FileNameExtension : 08 - Baptism by Fire.flac
FileName : 08 - Baptism by Fire
Title : Baptism by Fire
Album : Are You Ready? The Very Best Of
Album/Performer : AC/DC / AC/DC
Part : 1
Part/Position_Total : 2
Track : Baptism by Fire
Track/Position : 8
Track/Position_Total : 17
Performer : AC/DC
Label : Sony Japan
Genre : Hard Rock
Recorded_Date : 2016
ORIGINALDATE : 2016Code: Select all
Are You Ready - The Very Best Of AC DC (2016)Please help1
This is my current output:
Code: Select all
F:/AA/[2016]Are You Ready? The Very Best Of/AC DC AC DC/- Are You Ready? The Very Best Of/CD null/08 - Baptism by FireRe: Music Renaming
Groovy: Select all
media.'part/position'Properties: Select all
Part : 1
Part/Position_Total : 2e.g. use media.Part to generate Disk 1/2 naming:
Format: Select all
{ if (media.Part) "Disc $media.Part - $media.Part" }{ pi.pad(2) }Code: Select all
Disc 1 - 114e.g. check for both media.PartPosition and media.Part, in this order, since some files may only specify one or the other:
Format: Select all
{
def di = any{ media.PartPosition }{ media.Part }
if (di) "Disc $di - $di"
}
{
pi.pad(2)
}Format: Select all
{ if (music.medium) "Disc $music.medium - $music.medium" }{ pi.pad(2) }EDIT:
FileBot r9812 adds {medium} as a top-level binding so this will work with future releases:
Format: Select all
{ "Disc $medium - $medium" }{ pi.pad(2) }