_FILENAME unexpected behavior in action


I'm using this action group to rename and/or move various types of art often present within album folders and hit a snag I don't understand.

Format value:
Field:
_FILENAME
Format string:
$if($and($eql(%_filename%,front),$neql(%_directory%,Artwork)),Artwork\Front,%_filename%)

This action should simply check if the filename is "front" and if it is, put that file into the "Artwork" subdirectory while renaming it to "Front" if it's not already in the "Artwork" directory.
Which is what the action does. But not always the same way.

\Gjerstad, Frode; Nilssen-Love, Paal\Nearby Faraway
grafik
This is the album I'm using for demonstration purposes.

grafik
When I open the album folder in mp3-tag like this and run the action on all selected files, the result is as expected:
grafik
A subfolder named "Artwork" is created which contains Front.jpg and Inlay.jpg.

So far so good.

grafik
When I open the artist folder in mp3-tag like this and run the action on all selected files, the result is:
grafik

And I don't understand why. Neither the values for %_filename% nor %_directory% nor %_folderpath% change within mp3-tag (I'm displaying all as columns) when I
a) open the files within the folder in mp3-tag
b) open the album folder in mp3-tag
c) open the artist folder in mp3-tag
Which leaves me confused as to why the behavior changes based on from which folder depth I open the files in mp3-tag.

Could someone explain it to me?

nvm found the solution myself.
https://docs.mp3tag.de/converters/rename-files/

The same is also possible using relative path names (instead of an absolute path in the example above) which creates the new directory relative to the current working directory:
%artist% - %year% - %album%\$num(%track%,2). %title%

The part with the current working directory eluded me. Adding %_folderpath% like this resolved my issue.

Format value:
Field:
_FILENAME
Format string:
$if($and($eql(%_filename%,front),$neql(%_directory%,Artwork)),%_folderpath%\Artwork\Front,%_filename%)

Feel free to delete this post.

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