[Feature Suggestion] Support for Creating Symlinks

Hi Mp3tag community! I just had an idea for a feature, perhaps it has been discussed here before. This would make the most sense for remixed songs.

I currently use an action to populate the MIXARTIST field using the following format string:

$regexp(%title%,.+\((.*?) remix\),$1)

I use this as a way to capture the Remixer's name and save it to ID3. I tend to follow up this action with a move-file action. In this case, mine looks like:

$left(C:\Music\$ansi($if(%compilation%,%artist%,%albumartist%))\$if(%compilation%,"",$validate($replace(%album%,.,-),-))\$if(%compilation%,$replace(%title%,.,_),$num(%discnumber%,1)$num(%track%,2) $replace($replace(%title%, / ,-),.,_)),128)

Which basically moves the song into an artist or album artist folder within my root Music folder. So that's neat. :slight_smile: Now one thing I realized would be that, when I'm going back looking for this remix, it might be confusing to me to remember who the original artist was and what folder the song is in. I just know the DJ who remixed the song. Or perhaps I want to keep an artist's remixes all together in one folder.

So what if I could create a symlink to the original song, which is located in the original artists folder, but the symlink could be in the MIXARTIST's folder? That would be super handy! And then I wouldn't actually be duplicating the MP3 data in both places, it'd be just one file.

It's currently possible to do this in Windows command prompt using "mklink /H <symlink_filepath> <original_filepath>". But it'd be so so so nice if MP3Tag could do this as an action type somehow. It would even be possible to make this cross platform by alternatively doing this in UNIX as "ls -s <symlink_filepath> <original_filepath>".

Hope this is a possible feature that'd be super quick to implement! Would love to hear thoughts :blush:

Cheers,
Aswin

You can do this using the tools-function of Mp3Tag.
I use it together with the command-line-version of "Link Shell Extension".
https://schinagl.priv.at/nt/ln/ln.html

Thanks for the suggestion! I've never made a user-defined tool on MP3Tag before.

I've got Git Bash for Windows installed on my machine, so I'm going to use "ln.exe" from there.

image

What do I do at this step though? Does the "Parameter" line allow for ID3 fields to be used? How do I reference MIXARTIST say for example?

You seem to understand coding much better than I do.
Every time I have a problem to solve, I bite into it until I have the solution. Afterwards I unfortunately forget some things again.
So I don't quite know why I did it in this special way some years ago - using a batch file instead of a direct solution and if this was necessary.

Here is an example how I create an alternative folder-structure for tribute-albums. The tag-field "ORIGARTIST" holds the tribute artist.
Name: Tribute
Path: C:\windows\system32\cmd.exe
Parameter: /D/Q/U/C c:\batches\ln.cmd "%_folderpath%" "%_directory%" "d:\mp3s\symlinks\Tributes\%origartist%\$validate(%albumartist%, -) - $validate(%album%,)"

And here is the batch file "ln.cmd", containing some extra lines for testing. I am sure you have the skill to change the code to your personal needs.

@echo off
Echo.P0="%~0"
Echo.P1="%~1"
Echo.P2="%~2"
Echo.P3="%~3"
pause
cd ..
"c:\program files\ln\ln.exe" --symbolic "%~2" "%~3"
exit /B