default to 0
This commit is contained in:
parent
71c59e3217
commit
bc4969434c
1 changed files with 4 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue