CC-2607: Ability to adjust stream bitrate, type, etc from UI interface

- created table cc_stream_setting and it's initial entries
- pypo installation will generate liquidsoap.cfg on install time
based on information on cc_stream_setting table
This commit is contained in:
James 2011-08-12 15:19:30 -04:00
parent 1c81d0d238
commit 13285fdd63
16 changed files with 1952 additions and 3 deletions

View file

@ -21,7 +21,7 @@ from urlparse import urlparse
import base64
from configobj import ConfigObj
AIRTIME_VERSION = "1.9.0-devel"
AIRTIME_VERSION = "1.9.0"
def api_client_factory(config):
logger = logging.getLogger()
@ -526,6 +526,21 @@ class AirTimeApiClient(ApiClientInterface):
logger.error("Exception: %s", e)
return response
def get_stream_setting(self):
#logger = logging.getLogger()
try:
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["get_stream_setting"])
url = url.replace("%%api_key%%", self.config["api_key"])
req = urllib2.Request(url)
response = urllib2.urlopen(req).read()
response = json.loads(response)
except Exception, e:
response = None
#logger.error("Exception: %s", e)
return response
################################################################################
# OpenBroadcast API Client