Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: %path% shows doubled extension? (Read 841 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

%path% shows doubled extension?

Hello, I was trying to copy selected songs in a playlist from one drive to another while keeping the directory structure. I noticed that the string that %path% returns contains doubled extension, e.g "\path\to\file.mp3" becomes "\path\to\file.mp3.mp3" . I updated to v1.6.16 and the problem remained. I solved this by finding the length of the extension from the path, then adding 1 accounting for the ".", then removing those characters, but it was inconvenient. I'm not sure if it's just me or it's a bug. OS is Win7 64bit. Thanks.

Re: %path% shows doubled extension?

Reply #1
It's not a specific issue with %path%. The extension gets appended to any filename pattern that is added.

If it was required that people must set the extension themself, there's quite a lot of scope for it to go wrong which is probably why it's handled automatically.

 

Re: %path% shows doubled extension?

Reply #2
And it is quite a bit annoying to not have a %path_noext% ...

(I have proposed to support cmd modifiers, but then one would need something like %~dpath%%~ppath%%~npath%, and maybe that is a bit awkward.)

Re: %path% shows doubled extension?

Reply #3
You can use something like this to keep the folder structure but don't end up with double extensions:
Code: [Select]
$replace(%path%,%filename_ext%,%filename%,D:\,)
Where D:\ is the letter of the drive you are copying from (or just a path you don't want to copy over, like D:\Music\).

Re: %path% shows doubled extension?

Reply #4
There is a risk of the same string showing up elsewhere in the path. Say what you are trying to clean up contains
D:\Music\Demon - 1983 remaster 2001 - The Plague.flac\01 - The Plague.flac
D:\Music\Nightwish - 2001 - Over the Hills and Far Away.mp3\01 - Over the Hills and Far Away.mp3

Slightly more selective --> less chances of false positives: put slashes first.
Code: [Select]
$replace(%path%,\%filename_ext%,\%filename%,D:\,)

Will still not catch the a case where both directory and file are named "Mike Oldfield - 1990 - Amarok.mp3" (I guess singles or single track albums are more likely to omit track numbers)