CC-1799 : Live Studio Playout from media library (pytagsfs)
sending a file's metadata to airtime when it is modified
This commit is contained in:
parent
52efc79f8c
commit
15a2022418
4 changed files with 45 additions and 16 deletions
|
@ -98,7 +98,7 @@ class ApiClientInterface:
|
|||
def upload_recorded_show(self):
|
||||
pass
|
||||
|
||||
def update_media_metadata(self):
|
||||
def update_media_metadata(self, md):
|
||||
pass
|
||||
|
||||
# Put here whatever tests you want to run to make sure your API is working
|
||||
|
@ -350,18 +350,20 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
|
||||
return response
|
||||
|
||||
def update_media_metadata(self):
|
||||
def update_media_metadata(self, md):
|
||||
logger = logging.getLogger()
|
||||
response = None
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["show_schedule_url"])
|
||||
#url = self.config["base_url"] + self.config["api_base"] + self.config["show_schedule_url"]
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_media_url"])
|
||||
logger.debug(url)
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
|
||||
data = urllib.urlencode(md)
|
||||
req = urllib2.Request(url, data)
|
||||
response = urllib2.urlopen(req)
|
||||
|
||||
response = urllib.urlopen(url)
|
||||
response = json.loads(response.read())
|
||||
logger.info("shows %s", response)
|
||||
logger.info("update media %s", response)
|
||||
|
||||
except Exception, e:
|
||||
logger.error("Exception: %s", e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue