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: m3u playlists & relative paths (Read 4675 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

m3u playlists & relative paths

Hi,

I'm using m3u playlists because of their near universal compatibility, and simple format.  My problem is that depending on where I access the m3u file from (it's stored on my file server) the path to the actual mp3 file varies.

My mp3s are all stored on a samba file server (soon to add nfs for linux clients). The share gets mounted as s: in windows. The files are stored under s:\mp3s\artist\album\01-track_name.mp3. I store m3u playlists under a separate directory called, imaginatively enough, playlists, i.e., s:\mp3s\playlists\my_favs.m3u.

When I save the m3u files under s:\mp3s\playlists\ the winamp (and foobar, too, it appears) sets an absolute path to the mp3 file as such:
Code: [Select]
S:\mp3s\Nine Inch Nails\The Downward Spiral\14 - Nine Inch Nails - Hurt.mp3

This breaks the playlist if I access it from a different computer that, say, doesn't mount the share as s:, but rather browses the network directly, like so:
Code: [Select]
\\Babylon\share\mp3s\Nine Inch Nails\The Downward Spiral

or if I'm accessing the mp3s from a linux client then the path would be like so:
Code: [Select]
/mnt/mp3s/Nine Inch Nails/The Downward Spiral/

etc.

So I need the mp3s to use relative paths--even if the mp3 is not in a subdirectory from where the playlist is saved.  For example, if I edit the m3u playlist so that it reads:
Code: [Select]
..\Nine Inch Nails\The Downward Spiral\14 - Nine Inch Nails - Hurt.mp3

This works perfectly in all cases (most players in linux are happy with backslashes).  the '..' climbs me back up into the mp3s directory so that I can descend back down into the artist/album/ directory.

Does anyone know of
(a) program that does this
(b) a way to make fubar do this
© a way to make winamp do this
?

Thanks

m3u playlists & relative paths

Reply #1
Foobarand Winamp will use relative paths when saving playlists, but only under certian conditions. The mp3 (or whatever) file must be in the same directory or a subdirectory of the location where the playlist is saved. So anything that would need a "..\" is out.

Your options, from most difficult to least:
1. Code a new foobar plugin that changes how playlists are saved to always use relative paths.

2. Use a search and replace tool to do a global replace of all "S:\mp3s\" instances with "..\". You'd have to redo this periodically whenever you saved new playlists. Foobar FPL files are not plain ascii text, so some tools may not work or bugger them up.

3. Save all your playlists in the root "mp3s" directory.