added error handling on the caller of replaygain instead of in api client

This commit is contained in:
Rudi Grinberg 2012-10-29 14:57:43 -04:00
parent 18d8e24a56
commit 2556f3ba30
2 changed files with 8 additions and 10 deletions

View file

@ -705,17 +705,12 @@ class AirtimeApiClient(object):
'pairs' is a list of pairs in (x, y), where x is the file's database
row id and y is the file's replay_gain value in dB
"""
#http://localhost/api/update-replay-gain-value/
try:
url = self.construct_url("update_replay_gain_value")
data = urllib.urlencode({'data': json.dumps(pairs)})
request = urllib2.Request(url, data)
url = self.construct_url("update_replay_gain_value")
data = urllib.urlencode({'data': json.dumps(pairs)})
request = urllib2.Request(url, data)
self.logger.debug(self.get_response_from_server(request))
except Exception, e:
self.logger.error("Exception: %s", e)
raise
self.logger.debug(self.get_response_from_server(request))
def notify_webstream_data(self, data, media_id):