LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 05-03-2004, 08:49 AM   #1
Napper
Member
 
Registered: Nov 2003
Distribution: Ubuntu Warty
Posts: 56

Rep: Reputation: 15
Saving m3u list in XMMS


Hi everybody,

this is ticking me off, I hope somebody knows a way around: I have my Musikfolder as a Fat32 partition, so my sis can listen to it, too, when she is in Windows (haven't managed confince her to to ride the penguin yet). Now, when I am putting together a new playlist using XMMS it all works fine and dandy on Linux and not so fine and dandy on Windows. Also, when I move that folder (folder with music plus appropriate m3u playlist) it becomes unusable. My only explaination is that XMMS is saving those list with absolute pathnames (like /mnt/win_d/Music/cool_band/cool_title_1.mp3) which of course aren't to be found any more once you move the darn thing or put it on a back-up CD, etc.

Is there a way to change this odd behavior? Alternatively, is there another Music software for Linux that can save playlists with relative pathnames?

Napper.
 
Old 05-03-2004, 05:26 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,104

Rep: Reputation: Disabled
It's weird - that is what xmms does and it does allow for reading slashes or backslashes, but there's no control over how it writes, that I can see. But
Code:
sed 's/\//\\/g;s/\\mnt\\win_d\\/C:/' playlist > winplaylist
should turn
/mnt/win_d/Music/cool_band/cool_title_1.mp3
into
C:\Music\cool_band\cool_title_1.mp3

You could do similar things if you wanted to make them relative - just chop them off to whatever point instead of adding the 'C:'.

My CLI tools seem to write playlists with full slash paths, too - not relative or backslashed. So does Zinf. Must be missing something.
 
Old 05-03-2004, 08:49 PM   #3
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 58
Relative filepaths in a playlist cause problems, because the path must be relative to the .m3u file. Moving the playlist will break it, as will moving the mp3s....

Maybe do a "windows_playlist.m3u" and "linux_playlist.m3u". Use xmms to create Linux playlists, and winamp (or whatever) to make the windows ones...

Don't know what else to tell you.
 
Old 05-04-2004, 12:12 AM   #4
Napper
Member
 
Registered: Nov 2003
Distribution: Ubuntu Warty
Posts: 56

Original Poster
Rep: Reputation: 15
Mhh... Okay, well then there is not much one can do about it I guess. Shame. Digiot, I will try what you suggested, though. Still, there are some very good arguments that speak for relative pathnames, one of them being if the playlist sits in the same folder as the music files, which usually is the case with my music folders. That also solves the problem with backslashes/normal slashes. I usually have a playlist called 00.m3u for each album I posses because this way it is at the top of each folder and can be executed the fastest. Ah, well. I will just chop those pathnames off manually than. (Don't you ever have to move/rename a folder?)
 
Old 05-04-2004, 12:35 AM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 58
he he, I planned well in advance how to organize my music directories to make sure there would be room for years to come...

If you keep your playlists in the same directory as the songs themselves, you should be able to just use the filename in your playlist (which should work with both linux and win. So, using awk with '/' as the field separator you should be able to prune the filepaths out of your playlists automatically rather than doing it by hand.
 
Old 05-04-2004, 12:04 PM   #6
Napper
Member
 
Registered: Nov 2003
Distribution: Ubuntu Warty
Posts: 56

Original Poster
Rep: Reputation: 15
Yeah, but I am gonna play stubborn and still claim that there is a very good argument for having playlists that have no path reference if pathname of m3u equals pathnames of mp3 and that is that those you can copy/move whereever you want to (eg: USB Stick, CD-Rom, girl-friends hard drive), and no pre-organizing will save you from that so there should be an option for it in XMMS! (Come on - debate me on this! I dare you! I double dare you!)

Hey - but I can go through the discomfort of manually editing them as suggested here. As alway: many thanks for yalls help! This really is a great community! Keep up the good work!!!
 
Old 05-04-2004, 05:04 PM   #7
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 58
Why would I debate you? You want to move your stuff around so you want no filepaths, I created a 30GB /home/music directory with ./a ./b ./c etc.. underneath, and I keep all of my .m3u's in the /home/music directory so I need the filepaths. Why would I want to move this stuff around? Everyone's needs are different.

If you really are gung-ho about this then hack the xmms source code so it only writes the filenames to .m3u files.
 
Old 06-30-2004, 03:04 PM   #8
Daliz
Member
 
Registered: Feb 2004
Distribution: Mandrake 10.1, Ubuntu 5.04
Posts: 75

Rep: Reputation: 15
I had the same problem but with a simple editor you'll get your playlists work properly. Check this out:

M3U Playlist generated by XMMS:

#EXTM3U
#EXTINF:370,Iron Maiden - Where Eagles Dare
/wd/Music/Iron Maiden/Iron Maiden - Where Eagles Dare.ogg
#EXTINF:408,Iron Maiden - Revelations
/wd/Music/Iron Maiden/Iron Maiden - Revelations.ogg
#EXTINF:231,Iron Maiden - Flight Of Icarus
/wd/Music/Iron Maiden/Iron Maiden - Flight Of Icarus.ogg
#EXTINF:328,Iron Maiden - Die With Your Boots On
/wd/Music/Iron Maiden/Iron Maiden - Die With Your Boots On.ogg
#EXTINF:250,Iron Maiden - The Trooper
/wd/Music/Iron Maiden/Iron Maiden - The Trooper.ogg
#EXTINF:293,Iron Maiden - Still Life
/wd/Music/Iron Maiden/Iron Maiden - Still Life.ogg
#EXTINF:221,Iron Maiden - Quest For Fire
/wd/Music/Iron Maiden/Iron Maiden - Quest For Fire.ogg
#EXTINF:206,Iron Maiden - Sun And Steel
/wd/Music/Iron Maiden/Iron Maiden - Sun And Steel.ogg
#EXTINF:445,Iron Maiden - To Tame A Land
/wd/Music/Iron Maiden/Iron Maiden - To Tame A Land.ogg

Simply remove the paths:

#EXTM3U
#EXTINF:370,Iron Maiden - Where Eagles Dare
Iron Maiden - Where Eagles Dare.ogg
#EXTINF:408,Iron Maiden - Revelations
Iron Maiden - Revelations.ogg
#EXTINF:231,Iron Maiden - Flight Of Icarus
Iron Maiden - Flight Of Icarus.ogg
#EXTINF:328,Iron Maiden - Die With Your Boots On
Iron Maiden - Die With Your Boots On.ogg
#EXTINF:250,Iron Maiden - The Trooper
Iron Maiden/Iron Maiden - The Trooper.ogg
#EXTINF:293,Iron Maiden - Still Life
Iron Maiden/Iron Maiden - Still Life.ogg
#EXTINF:221,Iron Maiden - Quest For Fire
Iron Maiden/Iron Maiden - Quest For Fire.ogg
#EXTINF:206,Iron Maiden - Sun And Steel
Iron Maiden/Iron Maiden - Sun And Steel.ogg
#EXTINF:445,Iron Maiden - To Tame A Land
Iron Maiden/Iron Maiden - To Tame A Land.ogg

...and it works
 
Old 06-30-2004, 03:09 PM   #9
Napper
Member
 
Registered: Nov 2003
Distribution: Ubuntu Warty
Posts: 56

Original Poster
Rep: Reputation: 15
A bit of work, considering the amount of playlists I have, but this seems to be "the" solution for the moment. Thank you very much for your reply!!!

Happy listening!

Napper
 
Old 02-20-2006, 05:48 PM   #10
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware 13.1
Posts: 1,445

Rep: Reputation: 74
This thread is quite old, but since I just made me a simple bash script to solve this task I thought I should share it. If you can use it, have fun

Code:
#!/bin/sh
#
# This script is used to strip absolute paths from
# a m3u playlist generated with xmms
# The output will be a playlist with relative paths
# and DOS formatted with \ as folder sep and DOS
# line endings
# 
# call script with absolute path to m3u playlist :P
# example: <scriptname> /path/to/playlist.m3u


# get the name of folder where the playlist is saved

  M3UFOLDER=$(dirname "$1")

# now replace all occurances of the folder name in which
# the playlist itself is saved and set this folder as base for
# relative paths
# change also to DOS format since xmms is able
# to read DOS and UNIX formatted files but I
# doubt that Winamp is able to do this
      
  cat "$1" | \
      sed s:"$M3UFOLDER":.:g | \
      sed 's:\/:\\:g' | \
      sed 's/$/\r/' \
      > "$1".relative

# in case the m3u playlist is in the same folder as the
# music files also remove the leading .\

  cat "$1".relative | sed 's/^.\\//g' > "$1".relative

# delete the original playlist by moving the new one over it
# seperated this step to allow to keep the old playlist easily
# uncomment if you dare to remove your old list ;)
  
# mv "$1".relative "$1"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
saving list of installed programs DAChristen29 Ubuntu 1 08-28-2005 04:58 PM
XMMS made M3U playlists rael_kid Linux - Newbie 6 06-01-2005 10:52 AM
.m3u files from xmms won't work with mp3 player ? matt_w_lambert Linux - Software 1 10-06-2004 01:23 AM
saving list of RPMS DAChristen29 Mandriva 8 08-23-2004 11:01 PM
opening m3u files in XMMS by default gbrad Linux - General 4 09-19-2002 02:01 AM


All times are GMT -5. The time now is 01:31 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration