CC-4114: separate Liquidsoap into its own init.d script

if liquidsoap restarts, automatically notify pypo
This commit is contained in:
Martin Konecny 2012-08-28 15:00:02 -04:00
parent 8cf048d459
commit 8d81ecf3ad
6 changed files with 59 additions and 2 deletions

View file

@ -229,6 +229,22 @@ class AirtimeApiClient():
except Exception, e:
logger.error("%s", e)
def notify_liquidsoap_started(self):
logger = self.logger
try:
url = "http://%s:%s/%s/%s" % (self.config["base_url"], \
str(self.config["base_port"]), \
self.config["api_base"], \
self.config["notify_liquidsoap_started"])
url = url.replace("%%api_key%%", self.config["api_key"])
self.get_response_from_server(url)
except Exception, e:
logger.error("Exception: %s", str(e))
"""
This is a callback from liquidsoap, we use this to notify about the
currently playing *song*. We get passed a JSON string which we handed to