[solved] Strange behavior with file rename

Hello everyone! I have been using my simple script for file rename:

$set(bits,%_bits_per_sample%)

$set(fileType,%_extension%)

$if($gt(%bits%,16),

%date% - %album%[$upper(%fileType%) - WEB - %bits%bit]/

$if($gt(%totaldiscs%,1),$num(%discnumber%,1)-$num(%tracknumber%,2) %title%, $num(%tracknumber%,2) %title%),

%date% - %album%/

$if($gt(%totaldiscs%,1),$num(%discnumber%,1)-$num(%tracknumber%,2) %title%, $num(%tracknumber%,2) %title%))

After some time of using it, i have noticed strange thing with musicbrainz behavoir. For example, i have “Maeror Tri” artist with “Yearning for the Secret(s) of Nature” album. I want to rename my files from this album according musicbrainz db, but if file title begins like 01 “first track title”, then file will not be renamed. But if i wiil change file name just 01. “first track title”, or just add some changes to file name, then title will just like in musicbrainz db.

If i change script to simple %tracknumber% %title behavoir exactly same.


I mean about this, picard don’t want to rename word registry.

I can’t reproduce the problem.
The script works regardless of the file name. It is also not clear to me how the file name can influence the renaming. The script uses only tags and variables.

I noticed that the script wants to move the files to specific folders, but in the options shown, the first option (in English: “Move files when saving”) is not checked.

I have tested it on Windows 11 and get this bug (even with default settings without any my custom scripts). It works as should on Windows 7, for example.

1 Like

Which versions?
If it depends on the operating system, it is probably a bug.
(I’ve tested on Linux)

Latest at this moment: 2.12.3

OK, could be helpful if it is a bug.

But again:

01 “first track title” is the structure you want to achieve. If you have NOT selected “move files” (as on your screenshot) it will change nothing. Folders are only created if you allow “move files”.
Have you checked settings on both systems?

Sorry for late reply. I have checked “Rename files” box. It just work out of box in Windows 7 and not Windows 11 with exactly same settings.

It’s working in Win7 without “Move files” enabled?

I’m not talking about “Rename files” - you have to select “Move files when saving”, the topmost option.

Thanks for the report. I can reproduce. The issue is happening whenever renaming would only change the filename casing and the filesystem is case-insensitive (as is the case on Windows). This is supposed to work, but it broke when we implemented support for long paths on Windows.

I added the ticket https://tickets.metabrainz.org/browse/PICARD-3013 and submitted a fix.

3 Likes

big thank you for creating ticket and fixing it!