# Total Discs number prefix in filename

**URL:** https://community.mp3tag.de/t/total-discs-number-prefix-in-filename/63158
**Category:** Support
**Created:** [December 20, 2023, 11:24am UTC](https://community.mp3tag.de/t/total-discs-number-prefix-in-filename/63158 "2023-12-20T11:24:16Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![useonlythedrugs](https://community.mp3tag.de/user_avatar/community.mp3tag.de/useonlythedrugs/32/15695_2.png) [@useonlythedrugs](https://community.mp3tag.de/u/useonlythedrugs)
#### Post date: [December 20, 2023, 11:24am UTC](https://community.mp3tag.de/t/total-discs-number-prefix-in-filename/63158/1 "2023-12-20T11:24:16Z")

</div>

Hello,

Long time user (and donator!) of MP3tag here.

I have been using the following to rename files based on tags for a number of years and I have noticed recently that some files this is no longer working. I use this for DJ compilations and various artist albums

"$ifgreater(%totaldiscs%,1,$num(%discnumber%,1)-,)$num(%track%,2) ~ %artist% ~ %title%"

This has always prefixed the disc number to the file name if there is more than one disc.

e.g.

1-01 ~ UnPlug ~ Time Unlimited (Ortus Airgap mix)

Can someone tell me if the syntax is correct?

Thanks!

---

<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: [December 20, 2023, 11:30am UTC](https://community.mp3tag.de/t/total-discs-number-prefix-in-filename/63158/2 "2023-12-20T11:30:30Z")

</div>

> [@useonlythedrugs](#):
>
> .... %totaldiscs% ...  
> This has always prefixed the disc number to the file name if there is more than one disc.

The syntax is OK for files that have a field called TOTALDISCS.  
You would have to check those files where it does not work whether the field is there.

---

<div class="post-metadata">

### Author: ![useonlythedrugs](https://community.mp3tag.de/user_avatar/community.mp3tag.de/useonlythedrugs/32/15695_2.png) [@useonlythedrugs](https://community.mp3tag.de/u/useonlythedrugs)
#### Post date: [December 20, 2023, 11:43am UTC](https://community.mp3tag.de/t/total-discs-number-prefix-in-filename/63158/3 "2023-12-20T11:43:10Z")

</div>

Thanks for the info and quick reply, I will investigate for the files I have had issues with.

Is the method I am using to do this (prefixing disc number for multi-disc albums) the best way? Or is there a better method?

---

<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: [December 20, 2023, 11:47am UTC](https://community.mp3tag.de/t/total-discs-number-prefix-in-filename/63158/4 "2023-12-20T11:47:00Z")

</div>

> [@useonlythedrugs](#):
>
> Is the method I am using to do this (prefixing disc number for multi-disc albums) the best way?

The "best way" is the one that gives you the result wanted.  
If you are happy with  
`1-01 ~ UnPlug ~ Time Unlimited (Ortus Airgap mix)`  
then it is the best way for you. 😉

If you show us a filename which does not work as expected, we can help you find the reason. It could also be a missing DISCNUMBER. Just show us a [screenshot](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190#use-screenshots-to-exemplify-the-issue-2) after pressing Alt+T on such a "not working" song.

---

<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: [December 20, 2023, 12:41pm UTC](https://community.mp3tag.de/t/total-discs-number-prefix-in-filename/63158/5 "2023-12-20T12:41:43Z")

</div>

> [@useonlythedrugs](#):
>
> Or is there a better method?

I would assume that any decent player does not rely on the filename but uses the tag data to sort, group and filter audio tracks.

The method will only become a good one if you stringently fill the field DISCNUMBER and (if appropriate) TOTALDISCS.  
The implicit "no disc number means there is only 1" is not good enough as it does not help to distinguish the treated files from the yet untreated ones.

---

<div class="post-metadata">

### Author: ![useonlythedrugs](https://community.mp3tag.de/user_avatar/community.mp3tag.de/useonlythedrugs/32/15695_2.png) [@useonlythedrugs](https://community.mp3tag.de/u/useonlythedrugs)
#### Post date: [December 20, 2023, 1:44pm UTC](https://community.mp3tag.de/t/total-discs-number-prefix-in-filename/63158/6 "2023-12-20T13:44:21Z")

</div>

Ok, i have it all figured out!

I had set this up some years ago and I guess not really thought too much about it... I was unaware of the "TOTALDISCS" tag and I imagined that the rename schema was looking for a disc number greater than 1 for any given album.

I can see that of course is not what it is doing now I've had your help (and some coffee!). I have tested the problematic files and of course they were missing the TOTALDISCS tag data. 🥴

I like to prefix the disc number just to help sorting/managing files in windows.

Thanks again for your help and Merry Christmas!

---

<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: [January 19, 2024, 1:44pm UTC](https://community.mp3tag.de/t/total-discs-number-prefix-in-filename/63158/7 "2024-01-19T13:44:49Z")

</div>

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