File: export_m3u

package info (click to toggle)
madman 0.93.0-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,060 kB
  • ctags: 3,309
  • sloc: cpp: 14,194; ansic: 13,331; sh: 100; makefile: 62; python: 54
file content (20 lines) | stat: -rwxr-xr-x 558 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# MADMAN-PLUGIN-VERSION: 2
# MADMAN-NAME: Export to Playlist (m3u)
# MADMAN-DESCRIPTION: Exports files to a m3u (WinAMP) playlist.
# MADMAN-ARGUMENTS: %ask:Save playlist as:% %repeat% %duration% %artist% %title% %path%/%file% %endrepeat%
# MADMAN-MENUSTRING: E&xport to Playlist (m3u)

if [ ! -e "$1" ]; then
  FILENAME=$1
  shift 1

  echo "#EXTM3U" > $FILENAME
  while [ "$4" != "" ]; do
    echo "#EXTINF:"$1","$2" - "$3 >> $FILENAME
    echo "$4" >> $FILENAME
    shift 4
  done
else
  xmessage "File already exists, will not overwrite" &
fi