diff --git a/airtime_mvc/application/controllers/WebstreamController.php b/airtime_mvc/application/controllers/WebstreamController.php
index e3e9e8246..73ad7fc59 100644
--- a/airtime_mvc/application/controllers/WebstreamController.php
+++ b/airtime_mvc/application/controllers/WebstreamController.php
@@ -27,6 +27,7 @@ class WebstreamController extends Zend_Controller_Action
$webstream->setDbName("Untitled Webstream");
$this->view->ws = new Application_Model_Webstream($webstream);
+ $this->view->action = "new";
$this->view->html = $this->view->render('webstream/webstream.phtml');
}
@@ -41,6 +42,7 @@ class WebstreamController extends Zend_Controller_Action
$webstream = CcWebstreamQuery::create()->findPK($id);
$this->view->ws = new Application_Model_Webstream($webstream);
+ $this->view->action = "edit";
$this->view->html = $this->view->render('webstream/webstream.phtml');
}
diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php
index d0194b54c..67d2883a0 100644
--- a/airtime_mvc/application/models/StoredFile.php
+++ b/airtime_mvc/application/models/StoredFile.php
@@ -893,7 +893,7 @@ class Application_Model_StoredFile
#something went wrong likely there wasn't enough space in the audio_stor to move the file too.
#warn the user that the file wasn't uploaded and they should check if there is enough disk space.
unlink($audio_file);//remove the file after failed rename
- $result = array("code" => 108, "message" => "The file was not uploaded, this error can occur if the computer hard drive does not have enough disk space.");
+ $result = array("code" => 108, "message" => "The file was not uploaded, this error can occur if the computer hard drive does not have enough disk space or the stor directory does not have correct write permissions.");
}
} else {
$result = array("code" => 110, "message" => "This file appears to be corrupted and will not be added to media library.");
diff --git a/airtime_mvc/application/views/scripts/webstream/webstream.phtml b/airtime_mvc/application/views/scripts/webstream/webstream.phtml
index 6f5653cdc..d3660bfc4 100644
--- a/airtime_mvc/application/views/scripts/webstream/webstream.phtml
+++ b/airtime_mvc/application/views/scripts/webstream/webstream.phtml
@@ -1,6 +1,6 @@
ws)) : ?>
-
+
ws)) : ?>
diff --git a/airtime_mvc/build/airtime-php.logrotate b/airtime_mvc/build/airtime-php.logrotate
new file mode 100644
index 000000000..6154e508e
--- /dev/null
+++ b/airtime_mvc/build/airtime-php.logrotate
@@ -0,0 +1,11 @@
+/var/log/airtime/zendphp.log {
+ compress
+ rotate 10
+ size 1000k
+ missingok
+ notifempty
+ sharedscripts
+ postrotate
+ chown www-data:www-data /var/log/airtime/
+ endscript
+}
diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js
index dedd7c2b1..92bf939c9 100644
--- a/airtime_mvc/public/js/airtime/library/spl.js
+++ b/airtime_mvc/public/js/airtime/library/spl.js
@@ -360,7 +360,6 @@ var AIRTIME = (function(AIRTIME){
appendAddButton();
appendModAddButton();
removeButtonCheck();
-
}
//sets events dynamically for playlist entries (each row in the playlist)
@@ -600,6 +599,9 @@ var AIRTIME = (function(AIRTIME){
var $ws_id = $("#ws_id");
$ws_id.attr("value", json.streamId);
+ var $ws_id = $("#ws_delete");
+ $ws_id.show();
+
//redraw the library to show the new webstream
redrawLib();
}
diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install
index 81b4bad7c..c7629c7dc 100755
--- a/install_minimal/airtime-install
+++ b/install_minimal/airtime-install
@@ -178,6 +178,9 @@ fi
if [ -e /etc/init.d/airtime-playout ]; then
invoke-rc.d airtime-playout stop > /dev/null 2>&1
fi
+if [ -e /etc/init.d/airtime-playout ]; then
+ invoke-rc.d airtime-liquidsoap stop > /dev/null 2>&1
+fi
#export these variables to make them available in sub bash scripts
export DO_UPGRADE
diff --git a/install_minimal/include/airtime-copy-files.sh b/install_minimal/include/airtime-copy-files.sh
index 236cf5f98..e839cdeff 100755
--- a/install_minimal/include/airtime-copy-files.sh
+++ b/install_minimal/include/airtime-copy-files.sh
@@ -88,15 +88,16 @@ ln -sf /usr/lib/airtime/utils/airtime-test-stream /usr/bin/airtime-test-stream
echo "* Creating /var/log/airtime"
mkdir -p /var/log/airtime
chmod a+x /var/log/airtime
-touch /var/log/airtime/zendphp.log
-chown www-data:www-data /var/log/airtime/zendphp.log
-chmod 644 /var/log/airtime/zendphp.log
+chown www-data:www-data /var/log/airtime/
+
if [ "$web" = "t" ]; then
echo "* Creating /usr/share/airtime"
rm -rf "/usr/share/airtime"
mkdir -p /usr/share/airtime
cp -R $AIRTIMEROOT/airtime_mvc/* /usr/share/airtime/
+ rm -f /etc/logrotate.d/airtime-php
+ cp $AIRTIMEROOT/airtime_mvc/build/airtime-php.logrotate /etc/logrotate.d/airtime-php
fi
echo "* Creating /var/log/airtime"
diff --git a/python_apps/pypo/airtime-liquidsoap-init-d b/python_apps/pypo/airtime-liquidsoap-init-d
new file mode 100755
index 000000000..cb3f0d675
--- /dev/null
+++ b/python_apps/pypo/airtime-liquidsoap-init-d
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+### BEGIN INIT INFO
+# Provides: airtime-playout
+# Required-Start: $local_fs $remote_fs $network $syslog
+# Required-Stop: $local_fs $remote_fs $network $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Liquidsoap daemon
+### END INIT INFO
+
+USERID=pypo
+GROUPID=pypo
+NAME="Liquidsoap Playout Engine"
+
+DAEMON=/usr/lib/airtime/pypo/bin/airtime-liquidsoap
+PIDFILE=/var/run/airtime-liquidsoap.pid
+
+start () {
+ start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID \
+ --nicelevel -15 --make-pidfile --pidfile $PIDFILE --startas $DAEMON
+
+ monit monitor airtime-liquidsoap >/dev/null 2>&1
+}
+
+stop () {
+ monit unmonitor airtime-liquidsoap >/dev/null 2>&1
+ /usr/lib/airtime/airtime_virtualenv/bin/python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py
+
+ # Send TERM after 5 seconds, wait at most 30 seconds.
+ start-stop-daemon --stop --oknodo --retry 5 --quiet --pidfile $PIDFILE
+ rm -f $PIDFILE
+}
+
+start_no_monit() {
+ start-stop-daemon --start --background --quiet --chuid $USERID:$USERID --make-pidfile --pidfile $PIDFILE --startas $DAEMON
+}
+
+
+case "${1:-''}" in
+ 'stop')
+ echo -n "Stopping Liquidsoap: "
+ stop
+ echo "Done."
+ ;;
+ 'start')
+ echo -n "Starting Liquidsoap: "
+ start
+ echo "Done."
+ ;;
+ 'restart')
+ # restart commands here
+ echo -n "Restarting Liquidsoap: "
+ stop
+ start
+ echo "Done."
+ ;;
+ 'start-no-monit')
+ # restart commands here
+ echo -n "Starting $NAME: "
+ start_no_monit
+ echo "Done."
+ ;;
+
+ *) # no parameter specified
+ echo "Usage: $SELF start|stop|restart"
+ exit 1
+ ;;
+
+esac
diff --git a/python_apps/pypo/airtime-playout-init-d b/python_apps/pypo/airtime-playout-init-d
index c2e27f320..499f6e1d7 100755
--- a/python_apps/pypo/airtime-playout-init-d
+++ b/python_apps/pypo/airtime-playout-init-d
@@ -9,80 +9,30 @@
# Short-Description: Manage airtime-playout daemon
### END INIT INFO
-USERID=pypo
-ROOTUSERID=root
-GROUPID=pypo
-NAME=Airtime\ Playout
+USERID=root
+NAME="Airtime Scheduler Engine"
-DAEMON0=/usr/lib/airtime/pypo/bin/airtime-playout
-PIDFILE0=/var/run/airtime-playout.pid
-
-DAEMON1=/usr/lib/airtime/pypo/bin/airtime-liquidsoap
-PIDFILE1=/var/run/airtime-liquidsoap.pid
-
-liquidsoap_start () {
- start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID \
- --nicelevel -15 --make-pidfile --pidfile $PIDFILE1 --startas $DAEMON1
-
- monit monitor airtime-liquidsoap >/dev/null 2>&1
-}
-
-liquidsoap_stop () {
- monit unmonitor airtime-liquidsoap >/dev/null 2>&1
- /usr/lib/airtime/airtime_virtualenv/bin/python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py
-
- # Send TERM after 5 seconds, wait at most 30 seconds.
- start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE1
- rm -f $PIDFILE1
-}
-
-stop_pypo () {
- monit unmonitor airtime-playout >/dev/null 2>&1
-
- # Send TERM after 5 seconds, wait at most 30 seconds.
- start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE0
- rm -f $PIDFILE0
-}
+DAEMON=/usr/lib/airtime/pypo/bin/airtime-playout
+PIDFILE=/var/run/airtime-playout.pid
start () {
chown pypo:pypo /etc/airtime
chown pypo:pypo /etc/airtime/liquidsoap.cfg
- start-stop-daemon --start --background --quiet --chuid $ROOTUSERID:$ROOTUSERID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
+ start-stop-daemon --start --background --quiet --chuid $USERID:$USERID --make-pidfile --pidfile $PIDFILE --startas $DAEMON
monit monitor airtime-playout >/dev/null 2>&1
-
- liquidsoap_start
}
stop () {
# Send TERM after 5 seconds, wait at most 30 seconds.
monit unmonitor airtime-playout >/dev/null 2>&1
- start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE0
- rm -f $PIDFILE0
-
- liquidsoap_stop
-}
-
-monit_restart() {
-
- start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE0
- rm -f $PIDFILE0
-
- /usr/lib/airtime/airtime_virtualenv/bin/python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py
- start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE1
- rm -f $PIDFILE1
-
- start-stop-daemon --start --background --quiet --chuid $ROOTUSERID:$ROOTUSERID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
-
- start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID \
- --nicelevel -15 --make-pidfile --pidfile $PIDFILE1 --startas $DAEMON1
-
+ start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE
+ rm -f $PIDFILE
}
start_no_monit() {
- start-stop-daemon --start --background --quiet --chuid $ROOTUSERID:$ROOTUSERID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
- liquidsoap_start
+ start-stop-daemon --start --background --quiet --chuid $USERID:$USERID --make-pidfile --pidfile $PIDFILE --startas $DAEMON
}
case "${1:-''}" in
@@ -111,41 +61,13 @@ case "${1:-''}" in
start_no_monit
echo "Done."
;;
- 'monit-restart')
- # restart commands here
- echo -n "Monit Restarting $NAME: "
- monit_restart
- echo "Done."
- ;;
'status')
# status commands here
/usr/bin/airtime-check-system
;;
- 'stop-liquidsoap')
- echo -n "Stopping Liquidsoap: "
- liquidsoap_stop
- echo "Done."
- ;;
- 'start-liquidsoap')
- echo -n "Starting Liquidsoap: "
- liquidsoap_start
- echo "Done."
- ;;
- 'restart-liquidsoap')
- # restart commands here
- echo -n "Restarting Liquidsoap: "
- liquidsoap_stop
- liquidsoap_start
- echo "Done."
- ;;
- 'pypo-stop')
- # restart commands here
- echo -n "Restarting Pypo: "
- stop_pypo
- echo "Done."
- ;;
*) # no parameter specified
echo "Usage: $SELF start|stop|restart|status"
exit 1
;;
+
esac
diff --git a/python_apps/pypo/install/pypo-copy-files.py b/python_apps/pypo/install/pypo-copy-files.py
index 5d58890b1..31c4199cc 100644
--- a/python_apps/pypo/install/pypo-copy-files.py
+++ b/python_apps/pypo/install/pypo-copy-files.py
@@ -98,6 +98,7 @@ try:
#copy init.d script
shutil.copy(config["bin_dir"]+"/bin/airtime-playout-init-d", "/etc/init.d/airtime-playout")
+ shutil.copy(config["bin_dir"]+"/bin/airtime-liquidsoap-init-d", "/etc/init.d/airtime-liquidsoap")
#copy log rotate script
shutil.copy(config["bin_dir"]+"/bin/liquidsoap_scripts/airtime-liquidsoap.logrotate", "/etc/logrotate.d/airtime-liquidsoap")
diff --git a/python_apps/pypo/install/pypo-initialize.py b/python_apps/pypo/install/pypo-initialize.py
index b82d045f4..579fc7b1c 100644
--- a/python_apps/pypo/install/pypo-initialize.py
+++ b/python_apps/pypo/install/pypo-initialize.py
@@ -109,6 +109,7 @@ try:
if "airtime_service_start" in os.environ and os.environ["airtime_service_start"] == "t":
print "* Waiting for pypo processes to start..."
+ subprocess.call("invoke-rc.d airtime-liquidsoap start-no-monit > /dev/null 2>&1", shell=True)
subprocess.call("invoke-rc.d airtime-playout start-no-monit > /dev/null 2>&1", shell=True)
except Exception, e:
diff --git a/python_apps/pypo/liquidsoap_scripts/liquidsoap_auth.py b/python_apps/pypo/liquidsoap_scripts/liquidsoap_auth.py
index 7f6f3817c..862231cc2 100644
--- a/python_apps/pypo/liquidsoap_scripts/liquidsoap_auth.py
+++ b/python_apps/pypo/liquidsoap_scripts/liquidsoap_auth.py
@@ -13,6 +13,6 @@ if dj_type == '--master':
elif dj_type == '--dj':
source_type = 'dj'
-response = api_clients.check_live_stream_auth(username, password, type)
+response = api_clients.check_live_stream_auth(username, password, source_type)
print response['msg']
diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq
index 119283753..a99b89c02 100644
--- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq
+++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq
@@ -237,7 +237,7 @@ def add_skip_command(s)
server.register(namespace="source",
usage="skip",
description="Skip the current song.",
- "skip",skip)
+ "skip",fun(s) -> begin log("source.skip") skip(s) end)
end
dyn_out = output.icecast(%wav,
diff --git a/python_apps/pypo/liquidsoap_scripts/ls_script.liq b/python_apps/pypo/liquidsoap_scripts/ls_script.liq
index 04f05c8ce..c3bec6818 100644
--- a/python_apps/pypo/liquidsoap_scripts/ls_script.liq
+++ b/python_apps/pypo/liquidsoap_scripts/ls_script.liq
@@ -57,55 +57,55 @@ ignore(output.dummy(stream_queue, fallible=true))
server.register(namespace="vars",
"pypo_data",
- fun (s) -> begin pypo_data := s "Done" end)
+ fun (s) -> begin log("vars.pypo_data") pypo_data := s "Done" end)
server.register(namespace="vars",
"stream_metadata_type",
- fun (s) -> begin stream_metadata_type := int_of_string(s) s end)
+ fun (s) -> begin log("vars.stream_metadata_type") stream_metadata_type := int_of_string(s) s end)
server.register(namespace="vars",
"show_name",
- fun (s) -> begin show_name := s s end)
+ fun (s) -> begin log("vars.show_name") show_name := s s end)
server.register(namespace="vars",
"station_name",
- fun (s) -> begin station_name := s s end)
+ fun (s) -> begin log("vars.station_name") station_name := s s end)
server.register(namespace="vars",
"bootup_time",
- fun (s) -> begin time := s s end)
+ fun (s) -> begin log("vars.bootup_time") time := s s end)
server.register(namespace="streams",
"connection_status",
- fun (s) -> begin "1:#{!s1_connected},2:#{!s2_connected},3:#{!s3_connected}" end)
+ fun (s) -> begin log("streams.connection_status") "1:#{!s1_connected},2:#{!s2_connected},3:#{!s3_connected}" end)
server.register(namespace="vars",
"default_dj_fade",
- fun (s) -> begin default_dj_fade := float_of_string(s) s end)
+ fun (s) -> begin log("vars.default_dj_fade") default_dj_fade := float_of_string(s) s end)
server.register(namespace="dynamic_source",
description="Enable webstream output",
usage='start',
"output_start",
- fun (s) -> begin webstream_enabled := true "enabled" end)
+ fun (s) -> begin log("dynamic_source.output_start") webstream_enabled := true "enabled" end)
server.register(namespace="dynamic_source",
description="Enable webstream output",
usage='stop',
"output_stop",
- fun (s) -> begin webstream_enabled := false "disabled" end)
+ fun (s) -> begin log("dynamic_source.output_stop") webstream_enabled := false "disabled" end)
server.register(namespace="dynamic_source",
description="Set the cc_schedule row id",
usage="id ",
"id",
- set_dynamic_source_id)
+ fun (s) -> begin log("dynamic_source.id") set_dynamic_source_id(s) end)
server.register(namespace="dynamic_source",
description="Start a new dynamic source.",
usage="start ",
"read_start",
- create_dynamic_source)
+ fun (s) -> begin log("dynamic_source.read_start") create_dynamic_source(s) end)
server.register(namespace="dynamic_source",
description="Stop a dynamic source.",
usage="stop ",
"read_stop",
- destroy_dynamic_source)
+ fun (s) -> begin log("dynamic_source.read_stop") destroy_dynamic_source(s) end)
default = amplify(id="silence_src", 0.00001, noise())
-default = rewrite_metadata([("artist","Airtime"), ("title", "offline")],default)
+default = rewrite_metadata([("artist","Airtime"), ("title", "offline")], default)
ignore(output.dummy(default, fallible=true))
master_dj_enabled = ref false
@@ -160,19 +160,18 @@ end
#auth function for live stream
def check_master_dj_client(user,password) =
+ log("master connected")
#get the output of the php script
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --master #{user} #{password}")
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
ret = list.hd(ret)
+
#return true to let the client transmit data, or false to tell harbor to decline
- if (ret == "True") then
- true
- else
- false
- end
+ ret == "True"
end
def check_dj_client(user,password) =
+ log("live dj connected")
#get the output of the php script
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}")
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
@@ -223,32 +222,32 @@ server.register(namespace="streams",
description="Stop Master DJ source.",
usage="master_dj_stop",
"master_dj_stop",
- fun (s) -> begin make_master_dj_unavailable() "Done." end)
+ fun (s) -> begin log("streams.master_dj_stop") make_master_dj_unavailable() "Done." end)
server.register(namespace="streams",
description="Start Master DJ source.",
usage="master_dj_start",
"master_dj_start",
- fun (s) -> begin make_master_dj_available() "Done." end)
+ fun (s) -> begin log("streams.master_dj_start") make_master_dj_available() "Done." end)
server.register(namespace="streams",
description="Stop Live DJ source.",
usage="live_dj_stop",
"live_dj_stop",
- fun (s) -> begin make_live_dj_unavailable() "Done." end)
+ fun (s) -> begin log("streams.live_dj_stop") make_live_dj_unavailable() "Done." end)
server.register(namespace="streams",
description="Start Live DJ source.",
usage="live_dj_start",
"live_dj_start",
- fun (s) -> begin make_live_dj_available() "Done." end)
+ fun (s) -> begin log("streams.live_dj_start") make_live_dj_available() "Done." end)
server.register(namespace="streams",
description="Stop Scheduled Play source.",
usage="scheduled_play_stop",
"scheduled_play_stop",
- fun (s) -> begin make_scheduled_play_unavailable() "Done." end)
+ fun (s) -> begin log("streams.scheduled_play_stop") make_scheduled_play_unavailable() "Done." end)
server.register(namespace="streams",
description="Start Scheduled Play source.",
usage="scheduled_play_start",
"scheduled_play_start",
- fun (s) -> begin make_scheduled_play_available() "Done." end)
+ fun (s) -> begin log("streams.scheduled_play_start") make_scheduled_play_available() "Done." end)
if output_sound_device then
@@ -303,7 +302,7 @@ if s1_enable == true then
else
s1_namespace := s1_mount
end
- server.register(namespace=!s1_namespace, "connected", fun (s) -> begin !s1_connected end)
+ server.register(namespace=!s1_namespace, "connected", fun (s) -> begin log("#{!s1_namespace}.connected") !s1_connected end)
output_to(s1_output, s1_type, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_description, s1_genre, s1_user, s, "1", s1_connected, s1_description)
end
@@ -313,7 +312,7 @@ if s2_enable == true then
else
s2_namespace := s2_mount
end
- server.register(namespace=!s2_namespace, "connected", fun (s) -> begin !s2_connected end)
+ server.register(namespace=!s2_namespace, "connected", fun (s) -> begin log("#{!s2_namespace}.connected") !s2_connected end)
output_to(s2_output, s2_type, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_description, s2_genre, s2_user, s, "2", s2_connected, s2_description)
end
@@ -324,7 +323,7 @@ if s3_enable == true then
else
s3_namespace := s3_mount
end
- server.register(namespace=!s3_namespace, "connected", fun (s) -> begin !s3_connected end)
+ server.register(namespace=!s3_namespace, "connected", fun (s) -> begin log("#{!s3_namespace}.connected") !s3_connected end)
output_to(s3_output, s3_type, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_description, s3_genre, s3_user, s, "3", s3_connected, s3_description)
end
diff --git a/python_apps/pypo/monit-airtime-liquidsoap.cfg b/python_apps/pypo/monit-airtime-liquidsoap.cfg
index aececd388..963f73800 100644
--- a/python_apps/pypo/monit-airtime-liquidsoap.cfg
+++ b/python_apps/pypo/monit-airtime-liquidsoap.cfg
@@ -5,5 +5,5 @@
check process airtime-liquidsoap
with pidfile "/var/run/airtime-liquidsoap.pid"
- start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds
+ start program = "/etc/init.d/airtime-liquidsoap start" with timeout 5 seconds
stop program = "/etc/init.d/airtime-playout stop"
diff --git a/python_apps/pypo/pypocli.py b/python_apps/pypo/pypocli.py
index cc0f689ed..8a1370a79 100644
--- a/python_apps/pypo/pypocli.py
+++ b/python_apps/pypo/pypocli.py
@@ -130,7 +130,7 @@ def liquidsoap_running_test(telnet_lock, host, port, logger):
msg = "version\n"
tn.write(msg)
tn.write("exit\n")
- logger.info("Liquidsoap version %s", tn.read_all())
+ logger.info("Found: %s", tn.read_all())
except Exception, e:
logger.error(str(e))
success = False
@@ -210,7 +210,7 @@ if __name__ == '__main__':
recorder.start()
# all join() are commented out because we want to exit entire pypo
- # if pypofetch is exiting
+ # if pypofetch is exiting
#pmh.join()
#recorder.join()
#pp.join()
diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py
index e1b6771b7..3f7cceb6e 100644
--- a/python_apps/pypo/pypofetch.py
+++ b/python_apps/pypo/pypofetch.py
@@ -8,6 +8,7 @@ import json
import telnetlib
import copy
from threading import Thread
+import subprocess
from Queue import Empty
@@ -86,7 +87,7 @@ class PypoFetch(Thread):
self.process_schedule(self.schedule_data)
elif command == 'update_stream_setting':
self.logger.info("Updating stream setting...")
- self.regenerateLiquidsoapConf(m['setting'])
+ self.regenerate_liquidsoap_conf(m['setting'])
elif command == 'update_stream_format':
self.logger.info("Updating stream format...")
self.update_liquidsoap_stream_format(m['stream_format'])
@@ -142,14 +143,14 @@ class PypoFetch(Thread):
def switch_source(logger, lock, sourcename, status):
logger.debug('Switching source: %s to "%s" status', sourcename, status)
command = "streams."
- if(sourcename == "master_dj"):
+ if sourcename == "master_dj":
command += "master_dj_"
- elif(sourcename == "live_dj"):
+ elif sourcename == "live_dj":
command += "live_dj_"
- elif(sourcename == "scheduled_play"):
+ elif sourcename == "scheduled_play":
command += "scheduled_play_"
- if(status == "on"):
+ if status == "on":
command += "start\n"
else:
command += "stop\n"
@@ -204,12 +205,41 @@ class PypoFetch(Thread):
fh.write(api_client.encode_to(buffer_str))
fh.write("log_file = \"/var/log/airtime/pypo-liquidsoap/