On 19-10-2009 at 18:34, Alessandro Ranellucci wrote:

  >I definitely agree with your thougths. add_protocol is very
  >interesting. I will look into using it for this workflow:
  >
  >- liquidsoap triggers the reload of the playlist (via the telnet
  >command
  >   or the configuration timeout)
  >- an external shell script is invoked that makes hard links 
of all
  >   available files to a different directory;
  >- the list of files is returned to liquidsoap.

Done!

Let me share my solution with the mailing list.

This is my shell script:

#!/bin/sh
basedir=/srv/data1/playlists
filesdir=${basedir}/$1
tmpdir=${basedir}/tmp/$1
IFS="
"
if [ -n "$1" ] && [ -d "$filesdir" ] ; then
     mkdir -p $tmpdir
     for file in `find $tmpdir -maxdepth 1 -type f -name 
'*.mp3'`; do
         rm "$file"
     done
     for track in $filesdir/*.mp3 ; do
         ln "$track" $tmpdir/
     done
     find $tmpdir -maxdepth 1 -type f -name '*.mp3' > $tmpdir/playlist.txt
     echo $tmpdir/playlist.txt
     exit 0
else
     exit 1
fi

This is my liquidsoap configuration:

add_protocol(
   "myplaylist",
   fun (arg,delay) -> get_process_lines("/path/to/my-playlist.sh "^quote(arg)))

my_playlist = 
playlist(mode="normal",reload=600,mime_type="audio/x-mpegurl","myplaylist:PLAYLISTNAME")

mp3 files are stored under /srv/data1/playlists/PLAYLISTNAME

Cheers,

     - alessandro.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to