Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Auto disc number by sub-folders (Read 2817 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Auto disc number by sub-folders

I have a parent directory with 12 folders for 12 discs. Instead of manually having to number each folder with disc number 1, 2, etc. I want foobar to infer the disc number based on directory structure like it does with track autonumbering. How do I do it?

Re: Auto disc number by sub-folders

Reply #1
Which one is going to have "1", which is "7" etc.? Is the discnumber clear from the subdirectory name?

Re: Auto disc number by sub-folders

Reply #2
Which one is going to have "1", which is "7" etc.? Is the discnumber clear from the subdirectory name?

Yep.
It's all lined up:
Parent/Disc 1 - 13/08/22/Track 1.flac
Parent/Disc 2 - 14/08/22/Track 1.flac
Parent/Disc 3 - 15/08/22/Track 1.flac

Re: Auto disc number by sub-folders

Reply #3
You aren't seriously using directory separators this way?
Code: [Select]
Parent
    / Disc 1 - 13
          / 08
                / 22
                       / Track 1.flac
?

Re: Auto disc number by sub-folders

Reply #4
You aren't seriously using directory separators this way?
Code: [Select]
Parent
    / Disc 1 - 13
          / 08
                / 22
                       / Track 1.flac
?

Oh gosh I forgot that dates aren't written with /

I meant my directory structure is:
Parent/Disc 1 - 13-08-22/Track 1.flac
Parent/Disc 2 - 14-08-22/Track 1.flac
Parent/Disc 3 - 15-08-22/Track 1.flac

Re: Auto disc number by sub-folders

Reply #5
(1) Select all files in playlist, and open file properties (Alt+Enter, or right-click them and select the bottom-most)
(2) Right-click in an empty part of that window and select Automatically fill values
(3) Source: select "Other", and in the text field: type
%directory%
(4) In Pattern, type (yes remember the hyphen, it is crucial!)
Disc %discnumber% -
See that under Preview, it is as you want it - for every file! Click OK.
(5) Here I would have hit Apply to commit, but don't close yet.
(6) Since you may have gotten space characters into your disc numbers: right-click "Disc Number" and you will find a "Clean up" (that will remove leading/trailing space) and there is also a "Fix spurious discnumbers". Do that, and OK and you should be fine.

And of course, dates are written 2022-08-13 as per ISO-8601  ;)  - but seriously: a triple CD set is released all CDs at the same on the same day, typically?!

Re: Auto disc number by sub-folders

Reply #6
(1) Select all files in playlist, and open file properties (Alt+Enter, or right-click them and select the bottom-most)
(2) Right-click in an empty part of that window and select Automatically fill values
(3) Source: select "Other", and in the text field: type
%directory%
(4) In Pattern, type (yes remember the hyphen, it is crucial!)
Disc %discnumber% -
See that under Preview, it is as you want it - for every file! Click OK.
(5) Here I would have hit Apply to commit, but don't close yet.
(6) Since you may have gotten space characters into your disc numbers: right-click "Disc Number" and you will find a "Clean up" (that will remove leading/trailing space) and there is also a "Fix spurious discnumbers". Do that, and OK and you should be fine

Absolutely amazing. Worked like a charm. Thanks!

And of course, dates are written 2022-08-13 as per ISO-8601  ;)  - but seriously: a triple CD set is released all CDs at the same on the same day, typically?!

I use dd/mm/yyyy because that's how we would write dates. More intuitive. The dates on the discs represent the dates of the respective live shows.


Re: Auto disc number by sub-folders

Reply #7
Then you would probably consider something like
Disc %discnumber% - %discsubtitle%
unless you already have the show date into some other tag.

ISO8601 is your friend for sorting. My (non-CD) bootlegs have their directories named like artist and then YYYY-MM-DD, and then the file explorer does the rest.

Re: Auto disc number by sub-folders

Reply #8
Then you would probably consider something like
Disc %discnumber% - %discsubtitle%
unless you already have the show date into some other tag.

ISO8601 is your friend for sorting. My (non-CD) bootlegs have their directories named like artist and then YYYY-MM-DD, and then the file explorer does the rest.

Oh for bootlegs, absolutely! Otherwise you end up with 11-12-1986 coming after 05-11-2011. That would be silly. In my case these live albums are interspersed with other types of albums so they can't be arranged chronologically anyway. For my bootleg folder, I do organized yy/mm/dd.

Re: Auto disc number by sub-folders

Reply #9
(1) Select all files in playlist, and open file properties (Alt+Enter, or right-click them and select the bottom-most)
(2) Right-click in an empty part of that window and select Automatically fill values
(3) Source: select "Other", and in the text field: type
%directory%
(4) In Pattern, type (yes remember the hyphen, it is crucial!)
Disc %discnumber% -
See that under Preview, it is as you want it - for every file! Click OK.
(5) Here I would have hit Apply to commit, but don't close yet.
(6) Since you may have gotten space characters into your disc numbers: right-click "Disc Number" and you will find a "Clean up" (that will remove leading/trailing space) and there is also a "Fix spurious discnumbers". Do that, and OK and you should be fine.

And of course, dates are written 2022-08-13 as per ISO-8601  ;)  - but seriously: a triple CD set is released all CDs at the same on the same day, typically?!

Follow up question: I want custom naming for track numbering that integrate current track number with parent directory's name. How would I do that?

For example folder 'Side A' has 'Track 01' whose track number is set to '1.'
I want its track number to become A01 by fetching only the last letter from the directory's name. How could I do that?

 

Re: Auto disc number by sub-folders

Reply #10
(1) Select all files in playlist, and open file properties (Alt+Enter, or right-click them and select the bottom-most)
(2) Right-click in an empty part of that window and select Automatically fill values
(3) Source: select "Other", and in the text field: type
%directory%
(4) In Pattern, type (yes remember the hyphen, it is crucial!)
Disc %discnumber% -
See that under Preview, it is as you want it - for every file! Click OK.
(5) Here I would have hit Apply to commit, but don't close yet.
(6) Since you may have gotten space characters into your disc numbers: right-click "Disc Number" and you will find a "Clean up" (that will remove leading/trailing space) and there is also a "Fix spurious discnumbers". Do that, and OK and you should be fine.

And of course, dates are written 2022-08-13 as per ISO-8601  ;)  - but seriously: a triple CD set is released all CDs at the same on the same day, typically?!

Follow up question: I want custom naming for track numbering that integrate current track number with parent directory's name. How would I do that?

For example folder 'Side A' has 'Track 01' whose track number is set to '1.'
I want its track number to become A01 by fetching only the last letter from the directory's name. How could I do that?
Try:
$upper($right(%directoryname%,1))$num(%track%,2)

Doesn't work great if the folder the track is in, is not Side A,B,C,D or CD 1,2,3.

Re: Auto disc number by sub-folders

Reply #11
(1) Select all files in playlist, and open file properties (Alt+Enter, or right-click them and select the bottom-most)
(2) Right-click in an empty part of that window and select Automatically fill values
(3) Source: select "Other", and in the text field: type
%directory%
(4) In Pattern, type (yes remember the hyphen, it is crucial!)
Disc %discnumber% -
See that under Preview, it is as you want it - for every file! Click OK.
(5) Here I would have hit Apply to commit, but don't close yet.
(6) Since you may have gotten space characters into your disc numbers: right-click "Disc Number" and you will find a "Clean up" (that will remove leading/trailing space) and there is also a "Fix spurious discnumbers". Do that, and OK and you should be fine.

And of course, dates are written 2022-08-13 as per ISO-8601  ;)  - but seriously: a triple CD set is released all CDs at the same on the same day, typically?!

Follow up question: I want custom naming for track numbering that integrate current track number with parent directory's name. How would I do that?

For example folder 'Side A' has 'Track 01' whose track number is set to '1.'
I want its track number to become A01 by fetching only the last letter from the directory's name. How could I do that?
Try:
$upper($right(%directoryname%,1))$num(%track%,2)

Doesn't work great if the folder the track is in, is not Side A,B,C,D or CD 1,2,3.

Can't try it right now but will try it in the future. Thanks for the help!