# Check if it is a multiple disc and tag Album field accordingly with the folder name

**URL:** <https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975>\
**Category:** Support\
**Created:** [February 6, 2023, 12:43pm UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975 "2023-02-06T12:43:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElimGarak](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a183cd/32.png) [@ElimGarak](https://community.mp3tag.de/u/ElimGarak)\
**Post date:** [February 6, 2023, 12:43pm UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/1 "2023-02-06T12:43:44Z")

</div>

Hello! The title is not very clear, sorry.  
Anyway...  
I wanted to know whether I could simplify the tagging of the album field.  
Sometimes it happens that I have multiple albums to tag from the same artist and I need to change the "Album" field so it is the same as the folder name. If this collection includes both single albums and multiple albums, I need to manually select the single album and run this action:

Format "ALBUM": %\_directory%  
Regular expression "ALBUM": "\d\d\d\d\s" -\> ""

Then I have to select the multiple albums and tell MP3 tag not to take the folder name but go up a folder and use that:

Format "ALBUM": %\_parent\_directory%  
Regular expression "ALBUM": "\d\d\d\d\s" -\> ""

Is there a way to do this selecting everything and applying a single action? Basically a way to make MP3tag check whether the folder contains a single album or a multiple disc album and act accordingly?

Thank you!

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [February 6, 2023, 12:53pm UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/2 "2023-02-06T12:53:23Z")

</div>

> [@ElimGarak](#):
>
> a way to make MP3tag check whether the folder contains a single album or a multiple disc album and act accordingly?

How would you distinct between a "single album" and a "multiple disc album" if you should describe it in words?  
What exactly can Mp3tag check for to be sure that one or the other album type exists?

---

<div class="post-metadata">

**Author:** ![ElimGarak](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a183cd/32.png) [@ElimGarak](https://community.mp3tag.de/u/ElimGarak)\
**Post date:** [February 6, 2023, 12:59pm UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/3 "2023-02-06T12:59:56Z")

</div>

Hi and first of all thank you for your help.

Usually, if it is a multiple disc, it is like this:

- "YEAR" "ALBUM TITLE"  
|--------"ART FOLDER (if present)  
|--------"CD 1" (sometimes followed by a text, ie: "CD 1 - The original record")  
|--------"CD 2" (sometimes followed by a text, ie: "CD 2 - The new mix")  
|--------"CD 3" (sometimes followed by a text, ie: "CD 3 - Live in Bumblefuck")

etc.

Anyway, Mp3tag already recognizes this to reset disc numbers when applying automatic numbering.

---

<div class="post-metadata">

**Author:** ![ElimGarak](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a183cd/32.png) [@ElimGarak](https://community.mp3tag.de/u/ElimGarak)\
**Post date:** [February 6, 2023, 1:08pm UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/4 "2023-02-06T13:08:11Z")

</div>

When the album is single, there is no subfolder except often for the art folder. ie:

"YEAR" "ALBUM TITLE"  
|- ART FOLDER  
|-01 Song title.extension  
|-02 Song title.extension  
|-03 Song title.extension  
|-04 Song title.extension  
|-05 Song title.extension  
|-06 Song title.extension

etc.

Thanks again.

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [February 6, 2023, 4:44pm UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/5 "2023-02-06T16:44:05Z")

</div>

Does this mean you have a field like DISCTOTAL or TOTALDISCS filled in for all of your files? If so, you can filter for any albums when this field is greater than 1.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [February 6, 2023, 5:37pm UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/6 "2023-02-06T17:37:48Z")

</div>

How often in the life of your collection will the album have to be renamed?  
Honestly, I would filter for the files where \_DIRECTORY contains CD plus a number, get the data with Convert\>Filename - Tag and a lot of dummys and then filter for those that don't match this pattern and use Convert\>tag-Tag for ALBUM.

So try  
`%_directory% MATCHES "CD\s*\d+"`  
and  
`NOT %_directory% MATCHES "CD\s*\d+"`

and I bet that all future ALBUM fields will contain the correct data so that it does not have to be imported from the folder name.

---

<div class="post-metadata">

**Author:** ![ElimGarak](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a183cd/32.png) [@ElimGarak](https://community.mp3tag.de/u/ElimGarak)\
**Post date:** [February 7, 2023, 9:03am UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/7 "2023-02-07T09:03:53Z")

</div>

Thank you everyone. 🙂

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [February 7, 2023, 9:06am UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/8 "2023-02-07T09:06:11Z")

</div>

And what did you do in the end?

---

<div class="post-metadata">

**Author:** ![ElimGarak](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a183cd/32.png) [@ElimGarak](https://community.mp3tag.de/u/ElimGarak)\
**Post date:** [February 7, 2023, 9:11am UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/9 "2023-02-07T09:11:49Z")

</div>

I think I just will have to keep doing it manually, because I am not quite sure I can create an expression.  
Using basic, what I needed was: "IF [multilpe CDs] then DO this, ELSE do this".  
The point is that when I rip a CD, I use Easy CD-DA Extractor and it retrieves the informations capitalized in a way I don't like (ie: "The Lamb Lies Down On Broadway" instead of "The lamb lies down on Broadway"), so I rename the folder and apply its name to the tag.  
Anyway, thank you all for your help.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [February 7, 2023, 9:16am UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/10 "2023-02-07T09:16:23Z")

</div>

> [@ElimGarak](#):
>
> what I needed was: "IF [multilpe CDs] then DO this, ELSE do this".

Yes.  
But this would have become a rather lenghty expression which would have to have catered for variable strings with variable numbers.  
And that would be much easier to be achieved with a filter and a one-off for the 2 (or are there more?) cases. And it would be much safer to treat files where you can be sure that not the odd one out has crept in. A filter would give you this overview.  
It's a pity that you did not even try the filter.  
Here is the documentation on scripting functions:

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

**Author:** ![ElimGarak](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a183cd/32.png) [@ElimGarak](https://community.mp3tag.de/u/ElimGarak)\
**Post date:** [February 7, 2023, 9:29am UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/11 "2023-02-07T09:29:14Z")

</div>

Thank you so much, I will surely have a look at it.

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [March 9, 2023, 9:29am UTC](https://community.mp3tag.de/t/check-if-it-is-a-multiple-disc-and-tag-album-field-accordingly-with-the-folder-name/59975/12 "2023-03-09T09:29:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
