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

@ -45,7 +45,6 @@ remove_watched_dir = 'remove-watched-dir/format/json/api_key/%%api_key%%/path/%%
# URL to tell Airtime we want to add watched directory
set_storage_dir = 'set-storage-dir/format/json/api_key/%%api_key%%/path/%%path%%'
#############################
## Config for Recorder
#############################
@ -87,6 +86,8 @@ update_start_playing_url = 'notify-media-item-start-play/api_key/%%api_key%%/med
# ???
generate_range_url = 'generate_range_dp.php'
# URL to tell Airtime we want to get stream setting
get_stream_setting = 'get-stream-setting/format/json/api_key/%%api_key%%/'
##############
# OBP config #

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