Replace path when exporting m3u


#1

At the moment I'm using mp3tag to export playlists with following:

$filename(%_workingdir%.m3u,utf-8)#EXTM3U
$loop(%_directory%)$loop(%_filename_ext%)%_path%
$loopend()$loopend()

Trick is that for fileserver I would like to replace path during Export, so basically:
\\Server\music\Albums\Something\Something\Somefile.mp3 would become ../Albums/Something/Something/Somefile.mp3 during export.

Any ideas how to do it with the least effort?


#2

Instead of using %_path% directly, you do some replacements in the form of:

$replace(%_path%,'\\Server\music','..','\','/')


#3

Looks good, any Ideas how to actually avoid, hardcoding \\Server\ part?

..\music.. is always static anyways.


#4

It depends a little on where you you store your playlists. It looks like they are on

\\Server\music\Playlists\

so you could try

$replace(%_filename_rel%,'\','/')


#5

How did you find that out? :smiley:

But yes, indeed they are stored in \\Server\music\playlists\ later


#7

Thank you @Florian, settled with:

$filename(\\Server\music\playlists\%_workingdir%.m3u,utf-8)#EXTM3U
$loop(%_directory%)$loop(%_filename_ext%)$replace(%_filename_rel%,'\','/')
$loopend()$loopend()