default to 0

This commit is contained in:
j 2014-02-24 17:17:39 +05:30
parent 71c59e3217
commit bc4969434c

View file

@ -155,6 +155,8 @@ class Imdb(models.Model):
if 'votes' in data:
max_votes = ox.web.imdb.max_votes()
data['votes'] = 100 * float(data['votes']) / max_votes
else:
data['votes'] = 0
if 'reviews' in data:
reviews = []
@ -170,8 +172,8 @@ class Imdb(models.Model):
del data['reviews']
if 'posterId' in data:
del data['posterId']
data['likes'] = self.info('likes')
data['downloads'] = self.info('downloads')
data['likes'] = self.info('likes', 0)
data['downloads'] = self.info('downloads', 0)
data['links'] = self.links()
data['posters'] = self.posters(request)
if 'title' in data: