Rockbox Technical Forums
Third Party => Other Utilities => Topic started by: Neongrau on March 10, 2013, 10:26:15 AM
-
hi there, can anyone recommend a plugin for foobar2000 or a sepparate tool, which will do this job? right now i still have to edit each playlist manually.
-
If a path doesn't exist Rockbox treats it as a relative path so you shouldn't need to edit them. What are you trying to do?
-
ok maybe i should explain further... i create playlists with foobar on my pc library and sync later (msc) with my fuze. that is why i am looking for a way to save playlists in foobar directly with relative adjusted paths.
-
What do you mean by adjusted?
-
maybe a foobar plugin exists that automatically adjust the path when saving m3u
hd:\folder\folder\music\
to
..\music
-
You should ask the foobar people then.
-
If you just put the playlist in some folder below the one with the files it should work even without relative paths.
-
You should ask the foobar people then.
yes, but i thought my chances are not bad either asking over here first ;)
If you just put the playlist in some folder below the one with the files it should work even without relative paths.
well i tried what you suggested and it works for foobar, but the fuze wont play them. the path starts missing the initial ..\ infront.
i read somwhere that creating relative m3us with this structure is possible with mp3tag, but have to check further.
hard to believe there is no tool that will create relative m3us or correct the path later.
-
hard to believe there is no tool that will create relative m3us or correct the path later.
Shouldn't be hard to write a converter to change path names in a couple of lines of Python code. Or a similar scripting language.
-
hard to believe there is no tool that will create relative m3us or correct the path later.
I've use win's Notepad editor Find & Replace funtion for m3u's.
-
Shouldn't be hard to write a converter to change path names in a couple of lines of Python code. Or a similar scripting language.
yes and i wish i could write such a code..
I've use win's Notepad editor Find & Replace funtion for m3u's.
sure, i should have better written automatically. does there exist an editor where you can define a path (and save it) so just to hit ''find & replace''?
-
sure, i should have better written automatically. does there exist an editor where you can define a path (and save it) so just to hit ''find & replace''?
The windows Notepad editor has a funtion called "Replace" under the edit tab.
The prompt is:
Find what: E:\My music\
Replace with: /microSD1/
then press [Replace All]
be safe...make backups
before:
E:\tunes\U2\Unknown\Spanish Eyes.mp3
E:\tunes\Van Halen\Live Right Here, Right Now (Disc One)\05 Ain't Talkin' 'Bout Love.mp3
E:\tunes\Van Halen\Live Right Here, Right Now (Disk Two)\11 Top Of The World.mp3
E:\tunes\Van Halen\Live Right Here, Right Now (Disc One)\02 Judgement Day.mp3
E:\tunes\Ozzy Osbourne\Untitled\Ozzy Shot In The Dark.mp3
E:\tunes\Ozzy Osbourne\Bark At The Moon\01 Bark At The Moon.mp3
after:
/microSD1/U2\Unknown\Spanish Eyes.mp3
/microSD1/Van Halen\Live Right Here, Right Now (Disc One)\05 Ain't Talkin' 'Bout Love.mp3
/microSD1/Van Halen\Live Right Here, Right Now (Disk Two)\11 Top Of The World.mp3
/microSD1/Van Halen\Live Right Here, Right Now (Disc One)\02 Judgement Day.mp3
/microSD1/Ozzy Osbourne\Untitled\Ozzy Shot In The Dark.mp3
/microSD1/Ozzy Osbourne\Bark At The Moon\01 Bark At The Moon.mp3
-
that is what i do already.
i am talking about something similar like burrrn cueditor. there you can define a replace code. in the future all you have to do is hit a button. i found out that it works also with m3us, but it is very slow.
-
yes and i wish i could write such a code..
The following Python code can do it. It's rather simple (fails on the first line if the file contains a BOM and doesn't do error handling, but that shouldn't be much of a problem).
import sys
import os
infile = sys.argv[1]
basepath = os.path.dirname(os.path.abspath(infile))
outlines = []
fp = open(infile)
for line in fp.readlines():
if line.startswith('#'): # m3u comments start with #
outlines.append(line)
else:
outlines.append(os.path.relpath(line, basepath))
fp.close()
fp = open(infile, "w")
for line in outlines:
fp.write(line)
fp.close()
To use it: save it in a file on your PC, install Python, run it with Python and pass the name of the m3u file you want to get converted as argument. It will make all paths relative to the location of the m3u. If you have the file associations for Python scripts properly set you should be able to simply drop the m3u file on the script and it will do the conversion.
Also, foobar2000 will save m3u files with relative paths as long as you save them in the same or a parent folder of the files it contains -- i.e. if you have a folder /music/artist1/album1 and your playlist contains files in that folder you'll get relative paths in the m3u if you save it in /music, /music/artist1 or /music/artist1/album1. You get absolute paths if you save it in a location like /music/someotherfolder.
-
vielen dank bluebrother ;) i will check it out.
concerning foobar and relative m3us, have a look at my post above. it works for foobar, but the initial ..\ is missing, and rockbox wont load them.
music\..\%artist% - %title%
is this the only path that rockbox will accept in a m3u, or am i missing something?
..\music\..\%artist% - %title%
-
concerning foobar and relative m3us, have a look at my post above. it works for foobar, but the initial ..\ is missing, and rockbox wont load them.
This sounds like you're moving the playlist file around after saving it. Or how did you manage to produce this kind of files? It works fine for me.
-
It works fine for me.
a quick question, foobar does not create the ..\ within your m3us either, is that right?
-
nevermind, i saved once more to the music folder and got it working, thank you very much.