![]() Registered Member ![]()
|
Hi! How do I preserve a playlist order when transferring music to an external media-device?
My MP3-Player plays songs only in alphabetical order and does not seem to recognize .m3u files. The settings dialogue for media devices offers many choices for naming the files when transferring them, but I cannot find an option for a serial number based on the current playlist. I thought that prepending a serial number is the easiest way to preserve an Amarok playlist within the mp3-player. I also thought about using the comment field, but it is too awkward to type in a serial number in the comment field by hand for each song and each playlist. Furthermore my collection is shared with the rest of my family, so altering the comment fields is not a good option too. What can I do? (BTW, thanks for Amarok! It is truly a great Application! Oh, and my the player I refer to above is a Samsung YP-U2; its merit being its capability to play OGG-audio.) |
![]() Registered Member ![]()
|
This is a very simple script. Simple means badly coded
![]() The awk function (copy it to the file m3u2mp3.awk): #------------------------------------------------------------------------------------ BEGIN { { linha = 1 } { print "#!/bin/csh" } caminho = cam } { FS="[.:,]" } { if ( $1 !~ "#EXTM3U" ) { if ( $1 ~ "#EXTINF" ) { { nome = $NF } { linha ++ } } else { if ( $NF ~ "ogg" ) { { printf "sox \"%s\" tmp.wav\n", $0 } { printf "lame tmp.wav " } { printf " \"%s/%s/", caminho, FILENAME } { if ( linha < 10 ) printf "00" } { if ( linha >= 10 ) printf "0" } { printf "%s - %s.mp3\"\n" , linha, nome } } else { { printf "cp -rf " } { printf " \"%s\" ", $0 } { printf " \"%s/%s/", caminho, FILENAME } { if ( linha < 10 ) printf "00" } { if ( linha >= 10 ) printf "0" } { printf "%s - %s.mp3\"\n" , linha, nome } } } } } #------------------------------------------------------------------------ And the csh script ( i did call it m3u2mp3.csh): #!/bin/tcsh if ( $2 == "" ) then mkdir tmp mkdir ./tmp/$1.m3u awk -f m3u2mp3.awk -v cam=tmp $1.m3u > comands.csh else if ( $2 != "" ) then #if ( $2 == /media/usbdisk ) then mkdir $2/$1.m3u awk -f m3u2mp3.awk -v cam=$2 $1.m3u > comands.csh endif chmod 755 ./comands.csh ./comands.csh Call the script ./m3u2mp3.csh It does not works correctly with lots of meta caracters on the filenames. Truly, its is not a fully functional script. I did promise to myself I'will write it as a amarok plugin... best regards edilson |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]