Support and General Use > Audio Playback, Database and Playlists
Directories in M3U files?
Llorean:
It sounds like your real problem is that your podcatcher doesn't let you pick where to put the files?
brianary:
--- Quote from: Llorean on January 30, 2008, 01:20:22 AM ---It sounds like your real problem is that your podcatcher doesn't let you pick where to put the files?
--- End quote ---
I suppose that's fair. Being closed source, I don't expect a lot of flexibility, and their responsiveness to my questions and suggestions has been nonexistant. But until Rockbox adds a module to run a podcatcher on the host OS, I prefer this to something that requires installation on the host OS and doesn't store the data on the DAP.
brianary:
For the time being, I built a bash and cmd script that reads each file named /playlists/*.dirs, each of which is expected to have a directory (/dirA/dir1) on each line. The scripts each build an .m3u file with the same base name as the .dirs file from the mp3, wma, ogg, and spx in each directory.
For anyone that is interested, here are the scripts (to be placed in the device root):
dirs2m3u.sh
--- Code: ---#/bin/bash
for dirs in playlists/*.dirs ; do
echo Build: ${dirs%.dirs}.m3u
if [ -f ${dirs%.dirs}.m3u ] ; then rm ${dirs%.dirs}.m3u ; fi
cat $dirs | while read d ; do
find "${d#/}" \( -iname '*.mp3' -o -iname '*.ogg' -o -iname '*.wma' \
-o -iname '*.spx' \) -printf '/' -print >>${dirs%.dirs}.m3u
done
done
echo Done.
--- End code ---
dirs2m3u.cmd
--- Code: ---@echo off
for %%a in (playlists\*.dirs) do (
echo Build: %%~pna.m3u
del %%~pna.m3u
for /f "tokens=*" %%d in (%%a) do (
for /f "tokens=2,3,4 delims=\" %%w in ('dir /b /s "%%d\*.mp3" "%%d\*.ogg" "%%d\*.wma" "%%d\*.spx" 2^>nul') do (
echo /%%w/%%x/%%y>>%%~pna.m3u
)
)
)
echo Done.
--- End code ---
ColdSphinx:
I've included all the audiofiletypes from filetypes.c
dirs2m3u.sh
--- Code: ---#/bin/bash
for dirs in playlists/*.dirs ; do
 echo Build: ${dirs%.dirs}.m3u
 if [ -f ${dirs%.dirs}.m3u ] ; then rm ${dirs%.dirs}.m3u ; fi
 cat $dirs | while read d ; do
   find "${d#/}" \( -iname '*.mp3' -o -iname '*.mp2' -o -iname '*.mpa' \
     -o -iname '*.mp1' -o -iname '*.ogg' -o -iname '*.wma' -o -iname '*.wmv' \
     -o -iname '*.asf' -o -iname '*.wav' -o -iname '*.flac' -o -iname '*.ac3' \
     -o -iname '*.a52' -o -iname '*.mpc' -o -iname '*.wv' -o -iname '*.m4a' \
     -o -iname '*.m4b' -o -iname '*.mp4' -o -iname '*.shn' -o -iname '*.aif' \
     -o -iname '*.aiff' -o -iname '*.spx' -o -iname '*.sid' -o -iname '*.adx' \
     -o -iname '*.nsf' -o -iname '*.nsfe' -o -iname '*.spc' -o -iname '*.ape' \
     -o -iname '*.mac' \) -printf '/' -print >>${dirs%.dirs}.m3u
 done
done
echo Done.
--- End code ---
Edit:
dirs2m3u.cmd
--- Code: ---@echo off
for %%a in (playlists\*.dirs) do (
echo Build: %%~pna.m3u
del %%~pna.m3u
for /f "tokens=*" %%d in (%%a) do (
for /f "tokens=2,3,4 delims=\" %%w in ('dir /b /s "%%d\*.mp3" "%%d\*.mp2" "%%d\*.mpa" "%%d\*.mp1" "%%d\*.ogg" "%%d\*.wma" "%%d\*.wmv" "%%d\*.asf" "%%d\*.wav" "%%d\*.flac" "%%d\*.ac3" "%%d\*.a52" "%%d\*.mpc" "%%d\*.wv" "%%d\*.m4a" "%%d\*.m4b" "%%d\*.mp4" "%%d\*.shn" "%%d\*.aif" "%%d\*.aiff" "%%d\*.spx" "%%d\*.sid" "%%d\*.adx" "%%d\*.nsf" "%%d\*.nsfe" "%%d\*.spc" "%%d\*.ape" "%%d\*.mac" 2^>nul') do (
echo /%%w/%%x/%%y>>%%~pna.m3u
)
)
)
echo Done.
--- End code ---
brianary:
Here are those changes, cleaned up a bit:
dirs2m3u.sh
--- Code: ---#/bin/bash
for dirs in playlists/*.dirs ; do
echo Build: ${dirs%.dirs}.m3u
if [ -f ${dirs%.dirs}.m3u ] ; then rm ${dirs%.dirs}.m3u ; fi
cat $dirs | while read d ; do
find "${d#/}" -regextype posix-egrep \
-iregex '.*\.(a(52|c3|dx|iff?|pe|sf)|flac|m(4[ab]|ac|p[1234ac])|nsfe?|ogg|s(hn|id|p[cx])|w(a?v|m[av]))$' \
-printf '/' -print >>${dirs%.dirs}.m3u
done
done
echo Done.
--- End code ---
dirs2m3u.cmd
--- Code: ---@echo off
for %%a in (playlists\*.dirs) do (
echo Build: %%~pna.m3u
del %%~pna.m3u
for /f "tokens=*" %%d in (%%a) do (
for /f "tokens=2,3,4 delims=\" %%w in ('dir /b /s "%%d\*.mp3" "%%d\*.mp2" "%%d\*.mpa" ^
"%%d\*.mp1" "%%d\*.ogg" "%%d\*.wma" "%%d\*.wmv" "%%d\*.asf" "%%d\*.wav" ^
"%%d\*.flac" "%%d\*.ac3" "%%d\*.a52" "%%d\*.mpc" "%%d\*.wv" "%%d\*.m4a" ^
"%%d\*.m4b" "%%d\*.mp4" "%%d\*.shn" "%%d\*.aif" "%%d\*.aiff" "%%d\*.spx" ^
"%%d\*.sid" "%%d\*.adx" "%%d\*.nsf" "%%d\*.nsfe" "%%d\*.spc" "%%d\*.ape" ^
"%%d\*.mac" 2^>nul') do (
echo /%%w/%%x/%%y>>%%~pna.m3u
)
)
)
echo Done.
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version