# Fill TOTALTRACKS correctly

**URL:** https://community.mp3tag.de/t/fill-totaltracks-correctly/68353
**Category:** Support
**Created:** [April 30, 2025, 11:30am UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353 "2025-04-30T11:30:04Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Roland](https://community.mp3tag.de/user_avatar/community.mp3tag.de/roland/32/8001_2.png) [@Roland](https://community.mp3tag.de/u/Roland)
#### Post date: [April 30, 2025, 11:30am UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/1 "2025-04-30T11:30:04Z")

</div>

To be able to distinguish albums at OS level, I would like to include the total number of tracks on an album in the directory name. Often the field TOTALTRACKS is missing or contains the value of only one CD\LP of the album. I am therefore looking for a way to correctly fill this field in an action for multi-CD albums (e.g. the Woodstock box set).  
Is there a simple solution?

---

<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: [April 30, 2025, 12:13pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/2 "2025-04-30T12:13:29Z")

</div>

> [@Roland](#):
>
> Often the field TOTALTRACKS is missing

TOTALTRACKS is a field only in MP4 files.  
Other formats use TRACK with the format e.g. `7/9`

I think that the total number of tracks always refers to one medium.  
If you want to have it in a different way, you have to set the auto numbering wizard accordingly and renumber the files.

---

<div class="post-metadata">

### Author: ![make-nz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/make-nz/32/18236_2.png) [@make-nz](https://community.mp3tag.de/u/make-nz)
#### Post date: [April 30, 2025, 1:33pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/3 "2025-04-30T13:33:01Z")

</div>

I have made some changes to my searches to pull this data from Discogs,  
but could not tweak it to show in the search results list, only in the details view. It works for me and I can now selct the right release.

Have a look:

 ![image](https://community.mp3tag.de/uploads/default/original/3X/6/b/6bc57c39405d2f885ef284ce1b1f23b1d2d1d0d9.png)

Edit:

> [@Track count column in Discogs results?](https://community.mp3tag.de/t/track-count-column-in-discogs-results/66459/3):
>
> Did some testing -- FVI: first time ever with WebSource scripts This would be nice to have in my opinion, but it's not doable as far as I can tell: Still, I like having the number of tracks on a disc inserted to my tags. FreeAC does this for me when I'm ripping CDs. It does count the tracks per disc and not per Album, of maybe 3 discs with 20 tracks each and that is howI like it! Now, when playing with the Discogs API and the file (\Roaming\Mp3tag\data\sources\Dis…

---

<div class="post-metadata">

### Author: ![Roland](https://community.mp3tag.de/user_avatar/community.mp3tag.de/roland/32/8001_2.png) [@Roland](https://community.mp3tag.de/u/Roland)
#### Post date: [April 30, 2025, 3:01pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/4 "2025-04-30T15:01:54Z")

</div>

> I think that the total number of tracks always refers to one medium.  
> If you want to have it in a different way, you have to set the auto numbering wizard accordingly and renumber the files.

I am satisfied with the results of the numbering wizard.  
I am currently seeking a counter in the name of the directory.  
If it would be helpful, I can set up a new tag.  
If it would be at all possible, it would be nice if someone could suggest a way to create a procedure that depends on the name of the album and that can handle a number of albums at a time.

---

<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: [April 30, 2025, 3:44pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/5 "2025-04-30T15:44:01Z")

</div>

The principle problem is: MP3tag does not compare the data of 2 different files. So, MP3tag does not know/detect when e.g. the string in ALBUM changes.  
Any kind of grouping would only work with an export - and then you would have to import the result somehow into the corresponding files.  
So I think it will be tricky

---

<div class="post-metadata">

### Author: ![make-nz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/make-nz/32/18236_2.png) [@make-nz](https://community.mp3tag.de/u/make-nz)
#### Post date: [April 30, 2025, 3:46pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/6 "2025-04-30T15:46:23Z")

</div>

File based this works:

 ![image](https://community.mp3tag.de/uploads/default/original/3X/a/7/a7fc4b87178f3d9bfa19e992b7a46f265b62c9bd.png)

But you want to have your files moved to new folder, right!?

EDIT:  
Have used mediamonkey in the past for this _Tools \> Auto-Organize Files_

---

<div class="post-metadata">

### Author: ![Roland](https://community.mp3tag.de/user_avatar/community.mp3tag.de/roland/32/8001_2.png) [@Roland](https://community.mp3tag.de/u/Roland)
#### Post date: [April 30, 2025, 4:24pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/7 "2025-04-30T16:24:09Z")

</div>

> [@ohrenkino](#):
>
> MP3tag does not know/detect when e.g. the string in ALBUM changes.

This is the problem I would like to overcome.  
Is there a way to have an internal variable?

> [@ohrenkino](#):
>
> I think it will be tricky

Can an export (on ALBUM level) help to achive this?

---

<div class="post-metadata">

### Author: ![Roland](https://community.mp3tag.de/user_avatar/community.mp3tag.de/roland/32/8001_2.png) [@Roland](https://community.mp3tag.de/u/Roland)
#### Post date: [April 30, 2025, 4:32pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/8 "2025-04-30T16:32:19Z")

</div>

> [@make-nz](#):
>
> But you want to have your files moved to new folder, right!?

Until today I use the following for each album:

 ![Unbenannt](https://community.mp3tag.de/uploads/default/original/3X/e/9/e9006bc02439551588a579acc27351a49e2ca9cd.jpeg)  
That means a rename on Windows. 🙂

---

<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: [April 30, 2025, 4:32pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/9 "2025-04-30T16:32:42Z")

</div>

Here is a quick&dirty counter export:

```auto
$filename(CountFiles.txt,utf-8)
$loop(%album%,1)$loop(%_filename%)$loopend()%album%: %_max_counter%
$loopend()
See if you can do something with the output.

```

Just an observation on the (first) action with $num(%discnumber%,2): this cuts away the part following the slash so, `2/3` would become `02`.  
After that you would not know how many discs there are in the disc set.

---

<div class="post-metadata">

### Author: ![Roland](https://community.mp3tag.de/user_avatar/community.mp3tag.de/roland/32/8001_2.png) [@Roland](https://community.mp3tag.de/u/Roland)
#### Post date: [April 30, 2025, 4:37pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/10 "2025-04-30T16:37:08Z")

</div>

@ohrenkino: Thank you for your immediate help.  
But at this moment I have to organise my luggage,  
as I will start my holiday tomorrow.  
But I will continue this process in July at the latest....

---

<div class="post-metadata">

### Author: ![make-nz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/make-nz/32/18236_2.png) [@make-nz](https://community.mp3tag.de/u/make-nz)
#### Post date: [April 30, 2025, 5:10pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/11 "2025-04-30T17:10:59Z")

</div>

> [@Roland](#):
>
> That means a rename on Windows. 🙂

Nice! 👏  
I never looked into this option. I rip my CDs in fre:ac in a very simple/strict way, never really have to fix on the folder level.

> [@ohrenkino](#):
>
> Here is a quick&dirty counter export:

I used to this in bash, but it was difficult to know if there were files missing due to a bad rip!

This way I can compare much better in the way I rip CDs and use mp3tag.  
If discogs does not have the right number, I add it myself.  
With AutoSelect option turned on I see the number of files right away.

 ![image](https://community.mp3tag.de/uploads/default/original/3X/c/b/cb61cf640f1832c345bba2b8bde2dbacf546b456.png)

---

<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: [August 31, 2025, 1:11pm UTC](https://community.mp3tag.de/t/fill-totaltracks-correctly/68353/12 "2025-08-31T13:11:31Z")

</div>

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