CC-2745: Show status of liquidsoap/icecast connection on Stream
Settings page - temp commit
This commit is contained in:
parent
d8c6b722ac
commit
efbd2f53d0
5 changed files with 15 additions and 11 deletions
|
@ -577,7 +577,9 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_liquidsoap_error"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = url.replace("%%error_msg%%", error_msg)
|
||||
error_msg = error_msg.replace('/', ' ')
|
||||
encoded_msg = urllib.quote(error_msg, '')
|
||||
url = url.replace("%%error_msg%%", encoded_msg)
|
||||
url = url.replace("%%stream_id%%", stream_id)
|
||||
logger.debug(url)
|
||||
req = urllib2.Request(url)
|
||||
|
|
|
@ -39,8 +39,7 @@ end
|
|||
|
||||
def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, user, s, stream) =
|
||||
def on_error(msg)
|
||||
system("airtime-check-system > ~/temp/temp1.log 2>&1")
|
||||
system("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --error='#{msg}' --stream-id=#{stream} > ~/temp/temp.log 2>&1")
|
||||
system("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --error='#{msg}' --stream-id=#{stream}")
|
||||
log("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --error='#{msg}' --stream-id=#{stream}")
|
||||
5.
|
||||
end
|
||||
|
|
|
@ -10,4 +10,4 @@ SCRIPT=`readlink -f $0`
|
|||
# Absolute path this script is in
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
cd ${SCRIPTPATH}/../ && python pypo-notify.py $1 $2 $3 $4 $5 $6 $7 $8 &
|
||||
cd ${SCRIPTPATH}/../ && python pypo-notify.py "$@"
|
||||
|
|
|
@ -47,7 +47,7 @@ parser = OptionParser(usage=usage)
|
|||
# Options
|
||||
parser.add_option("-d", "--data", help="Pass JSON data from liquidsoap into this script.", metavar="data")
|
||||
parser.add_option("-m", "--media-id", help="ID of the file that is currently playing.", metavar="media_id")
|
||||
parser.add_option("-e", "--error", help="liquidsoap error msg.", metavar="error_msg")
|
||||
parser.add_option("-e", "--error", action="store", dest="error", type="string", help="liquidsoap error msg.", metavar="error_msg")
|
||||
parser.add_option("-s", "--stream-id", help="ID stream", metavar="stream_id")
|
||||
parser.add_option("-c", "--connect", help="liquidsoap connected", action="store_true", metavar="connect")
|
||||
|
||||
|
@ -109,13 +109,13 @@ if __name__ == '__main__':
|
|||
# initialize
|
||||
logger = logging.getLogger()
|
||||
|
||||
if options.error_msg and options.stream_id:
|
||||
if options.error and options.stream_id:
|
||||
try:
|
||||
n = Notify()
|
||||
n.notify_liquidsoap_error(options.error_msg, options.stream_id)
|
||||
n.notify_liquidsoap_error(options.error, options.stream_id)
|
||||
except Exception, e:
|
||||
print e
|
||||
elif optioins.connect and options.stream_id:
|
||||
elif options.connect and options.stream_id:
|
||||
try:
|
||||
n = Notify()
|
||||
n.notify_liquidsoap_connection(options.stream_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue