Hi,

On 1/22/07, Bóna László <[EMAIL PROTECTED]> wrote:
I have the playlists in date format: 20070122AM.

base = "/radio/"
playlistpath=base ^ get_process_output("date +%Y%m%d%p")
day = playlist(playlistpath, mode="normalize")

In this script, the playlistpath is chosen once for all at startup.
Then it remains fixed. The playlist can be reloaded from that path
everyday if you want, but the path can't change everyday.

One solution is that you change a symbolic link (using cron or
whatever) "/radio/today" to today's playlist. Then, set the right
parameters to reload it. It isn't possible to reload a playlist at a
fixed time (I could do that if you really want it) but let's suppose
that it's enough to reload it every hour for example:
day = playlist(mode="randomize", reload=3600, "/radio/today")

This example does not work because the liquidsoap does not find the
playlist file(/radio/20070122AM).

One other source of mistake is that get_process_output returns
_exactly_ the process output, including newlines. Thus, liquidsoap was
actually looking for the file "/radio/20070122AM\n".

I hope all of this helps. It can be interesting to discuss further how
to get exactly what you want in pure liquidsoap script -- for example,
implement reload at a precise date. But it might be simpler to
consider using request.dynamic() with an appropriate (bash/perl/..)
script for this kind of specific control.

Feel free to ask more question, and have fun!
--
David

Reply via email to