Rename duplicate titles/filenames


imagine this situation:
I have loaded some files into MP3TAG.
All editing is done, the files are tagged as I want them. Especially the track ids are now sorted (1..n).
But I have left some files with exact the same artist and title.

track1: aritst a - song x
track2: artist b - song y
track3: artist c - song x
track4: artist a - song x
track5: artist b - song z
track6: artist a - song x
track7: artist b - song y

In that case tracks 1,4 and 6 are the first duplicates I mean, and tracks 2 and 7 are another pair.

So far I sort the files by track number, search for these duplicates and change the title to "original title 2" (or 3..n if 2 already exists).
I want to automate this process, but I am unsure where to start in MP3TAG, e.g. Actions or Tools.

So the end result should look like this:
track1: aritst a - song x
track2: artist b - song y
track3: artist c - song x
track4: artist a - song x 2
track5: artist b - song z
track6: artist a - song x 3
track7: artist b - song y 2

At the next step I would rename the files to "%artist% - %title%", so it would also work for me to do first the renaming accordingly and after that change the title (and artist) by reading the filename again...

Any suggestions where to start?

here something to read on the topic:

@ohrenkino, yes, right, the problem is the same.
But no solution so far...
The problem is that the part you wrote in the other topic "as the first file gets created according to the new pattern, you will easily be able to filter/sort those that have not been renamed" does often but not always helps
If there were an easy way to jump to these problematic files, or at least mark them somehow. The small window that pops up and telling me "cannot be created, not unique" does not help at all because I need to close it to edit the first file, and then I can't read the second anymore.

Since MP3TAG does not help here I was thinking of a solution like sending track number (or any other unique identifier) plus artist and title (or other fields) to an external program that wll rename the original files. But in that case I also have to send the filename, and worst of all, after that I have to make sure that the data in MP3TAG get re-read. While this is not really complicated to do I think that the single work steps are more complicated to do than to do the whole thing manually...

you could add a character like 2 underscores to the existing filename.
Then start the renaming process. Only the first one of the duplicates will get the intended name. All the others will keep the 2 underscores.
You could then filter for these characters and see the files where the renaming failed.
The unanswered question so far in this forum in general: how do you know it is a duplicate? Or could it be just coincidental that the tag data is the same but in fact the audio part features the remix, the maxi, the live version? And could it be that after the analysis the tag data has to be modified to cater for the new insights?

Actually (at least in my cases) I know already it is NOT a duplicate, the analysis is done already and I know it is a remix/live/extended/whatever version. The info about that might (if known) be part of the comment (or other fields), but in some cases I only know it is a different version, but not what the difference is.

And yes, I can force the renaming to tell me the differences. When all the files only have one artists I simply change the name of the artist temporary to identify the cuplrits. But these are exactly the steps I want to avoid.

So far I am not sure where to start to automate this, either with Tools, or Actions, or a new "Convert" (but I think this might not be possible).

So you could add that information to the title and avoid the duplication ...

To modify a field (e.g. artist) use Converter>Tag-Tag for ARTIST
Format string: %artist%_
To modify the filename use Converter>Filename-Filename
Old pattern: %1
New pattern %1__

To append TITLE with COMMENT:
Converter>Tag-Tag for TITLE
Format string: %title% %comment%

Like I said, it might be known.
In some (many!) cases it's not.

You could filter for the files where there is a comment:
comment PRESENT
Then you could check whether there are certain keywords that indicate a special version and filter for these, e.g.
comment HAS Radio version
and then append the title only for the filtered ones.

Same answer, there might be a comment. Or not.

But actually I never checked how the filters work.
Maybe I can filter on files where filename is not %artist% - %title%?

Generally, yes. But as there are probably a couple of characters in the tag data that are invalid for filenames, you will get a number of false positives.

Same answer: filter for the ones that have a comment.

No, they do not have a comment (at least not all of them), so that does not help at all.

But the filters work:
"$if($eql(%artist% - %title%,%_filename%),yes,no)" IS no

But the filter is always on (even thought I unchecked "Auto-appply filter", is it possible to keep the filter visible but only apply it when needed?

You can switch the filter on and off by pressing F3.
Auto-apply is the default and should be switched on - only when filtering really large collections the automatic filter may hinder the input of longer filter expressions in one go.

No doubt about that - only that you get also all the files where there are invalid characters for filenames in the tag data like question marks, asterisks, colons ... these usually get eliminated or replaced by something else when naming the file.