CC-3367: Display in Now Playing whether Live DJ stream and Live Master stream
are connected and give user the ability to block those streams - added stream source switch interface - backend code
This commit is contained in:
parent
d4a387e113
commit
f193047a1c
19 changed files with 383 additions and 38 deletions
|
@ -104,3 +104,6 @@ update_liquidsoap_status = 'update-liquidsoap-status/format/json/api_key/%%api_k
|
|||
#URL to check live stream auth
|
||||
check_live_stream_auth = 'check-live-stream-auth/format/json/api_key/%%api_key%%/username/%%username%%/password/%%password%%/djtype/%%djtype%%'
|
||||
|
||||
#URL to update source status
|
||||
update_source_status = 'update-source-status/format/json/api_key/%%api_key%%/sourcename/%%sourcename%%/status/%%status%%'
|
||||
|
||||
|
|
|
@ -583,6 +583,20 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
response = urllib2.urlopen(req).read()
|
||||
except Exception, e:
|
||||
logger.error("Exception: %s", e)
|
||||
|
||||
def notify_source_status(self, sourcename, status):
|
||||
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["update_source_status"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = url.replace("%%sourcename%%", sourcename)
|
||||
url = url.replace("%%status%%", status)
|
||||
|
||||
req = urllib2.Request(url)
|
||||
response = urllib2.urlopen(req).read()
|
||||
except Exception, e:
|
||||
logger.error("Exception: %s", e)
|
||||
|
||||
"""
|
||||
This function updates status of mounted file system information on airtime
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue