CC-3220: Stream Setting: Status box is stuck on waiting if nothing is
changed and click save - done - liquidsoap_update_error and liquidsoap_update_connection functions are combined into one function, liquidsoap_update_status, in various place - created various telnet commands in liquidsoap( connection check for each stream, connection status for all streams) - In liquidsoap, shoutcast stream doesn't use default id. It is more informative by using id with "shoutcast_stream_#{stream_number}
This commit is contained in:
parent
9665c970af
commit
c9c6a08a1c
8 changed files with 94 additions and 71 deletions
|
@ -82,24 +82,14 @@ class Notify:
|
|||
logger.debug("Response: "+json.dumps(response))
|
||||
|
||||
# @pram time: time that LS started
|
||||
def notify_liquidsoap_error(self, error_msg, stream_id, time):
|
||||
def notify_liquidsoap_status(self, msg, stream_id, time):
|
||||
logger = logging.getLogger()
|
||||
|
||||
logger.debug('#################################################')
|
||||
logger.debug('# Calling server to update liquidsoap error #')
|
||||
logger.debug('# Calling server to update liquidsoap status #')
|
||||
logger.debug('#################################################')
|
||||
logger.debug('error msg = '+ str(error_msg))
|
||||
response = self.api_client.notify_liquidsoap_error(error_msg, stream_id, time)
|
||||
logger.debug("Response: "+json.dumps(response))
|
||||
|
||||
# @pram time: time that LS started
|
||||
def notify_liquidsoap_connection(self, stream_id, time):
|
||||
logger = logging.getLogger()
|
||||
|
||||
logger.debug('#################################################')
|
||||
logger.debug('# Calling server to update liquidsoap connection#')
|
||||
logger.debug('#################################################')
|
||||
response = self.api_client.notify_liquidsoap_connection(stream_id, time)
|
||||
logger.debug('msg = '+ str(msg))
|
||||
response = self.api_client.notify_liquidsoap_status(msg, stream_id, time)
|
||||
logger.debug("Response: "+json.dumps(response))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -115,13 +105,13 @@ if __name__ == '__main__':
|
|||
if options.error and options.stream_id:
|
||||
try:
|
||||
n = Notify()
|
||||
n.notify_liquidsoap_error(options.error, options.stream_id, options.time)
|
||||
n.notify_liquidsoap_status(options.error, options.stream_id, options.time)
|
||||
except Exception, e:
|
||||
print e
|
||||
elif options.connect and options.stream_id:
|
||||
try:
|
||||
n = Notify()
|
||||
n.notify_liquidsoap_connection(options.stream_id, options.time)
|
||||
n.notify_liquidsoap_status("OK", options.stream_id, options.time)
|
||||
except Exception, e:
|
||||
print e
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue