Update of /cvsroot/lastbash/lastbash
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31327
Modified Files:
lastbash
Log Message:
The m3u playlist can contain more than 1 entry.
Index: lastbash
===================================================================
RCS file: /cvsroot/lastbash/lastbash/lastbash,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- lastbash 29 Nov 2006 14:55:38 -0000 1.57
+++ lastbash 29 Nov 2006 15:01:32 -0000 1.58
@@ -202,11 +202,20 @@
# $3 - extinf name
# $4 - file location / url
- echo "#EXTM3U" > "$1"
+ # Keep the filename
+ local FILE="$1"
+ shift 1
- # TODO Add support for multiple items in playlist
- echo "#EXTINF:$2,$3" >> "$1"
- echo "$4" >> "$1"
+ # Output the header
+ echo "#EXTM3U" > "${FILE}"
+
+ # Output the sets of 3 data: duration, name, location
+ while [ "$1" ]
+ do
+ echo "#EXTINF:$1,$2" >> "${FILE}"
+ echo "$3" >> "${FILE}"
+ shift 3
+ done
}
# Function: HTTP GET method implementation {{{1
|