I have a Slimserver running on Linux and a Windows workstation that is used to rip music and organize playlists with Media Jukebox. All music is stored on a Samba Share on the Linux box and works fine since the slimserver uses the same directory.
However one problem is that the playlists that I export from MJ in .m3u format doesn't work. The problem is that the workstation sees that path to the music as M:\ and the Server sees it as /usr/mp3. The workstation uses \ where the server uses / in the path.
I've noticed that a lot of people seem to have similar problems but I really haven't found a good solution so I did a quick-and-dirty solution that works ok for me. It's a small script on the Linux-server that looks like this:
ls /usr/playlists/*.m3u | while read -e FNAME
do
sed -e 's/M:\\/\/usr\/mp3\//g' "$FNAME" > "${FNAME}2"
rm -f "$FNAME"
sed -e 's/\\/\//g' "${FNAME}2" > "$FNAME"
rm -f "${FNAME}2"
done
The first sed line changes the M:\ to /usr/mp3 and the second one changes \ to /. Whenever the script is run it changes this for all files named .m3u in the playlist directory. Every time I've exported a playlist I run the scripts. It can also be scheduled.
To make it work for another setup the paths (M:\ and /usr/mp3) needs to be changed. Hope someone finds it useful. It's been at least 10 years since I did any shell programming so it's not exactly beautiful but it works. Any suggestions on improvements are welcome
I briefly checked what other possible solution might exist and I found two roads that might be better.
1) Using a Samba VFS (Virtual File System) and change the read and write functions so that these changes are being made during read and write. Possibly this could work both ways so that the files could be both opened and writtten to from the workstation.
2) Also there is a sw called FAM (File Alteration Maonitor) that possibly could be used to automate file changes as soon as a file is dropped in the playlist directory.
If anyone have had success with these two options please share your experences. Even better would of course be if something similar could be built in to the slimserver. Maybe a configurable importfilter for playlists that can change the playlists as they are imported and exported.
/ Peter
Results 1 to 3 of 3
Threaded View
-
2005-10-03, 05:32 #1Junior Member
- Join Date
- Oct 2005
- Posts
- 12
Playlist synch with Linux and Windows

Reply With Quote
