Skip to content

Commit

Permalink
Fix case when imdb item has no score
Browse files Browse the repository at this point in the history
  • Loading branch information
lepinkainen committed Feb 9, 2015
1 parent e5f76a2 commit ecee75b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyfibot/modules/module_urltitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,10 @@ def _handle_imdb(url):
name = data['Title']
year = data['Year']
rating = data['imdbRating']
votes = __get_views(int(data['imdbVotes'].replace(',', '')))
try:
votes = __get_views(int(data['imdbVotes'].replace(',', '')))
except ValueError:
votes = "0"
genre = data['Genre'].lower()

title = '%s (%s) - %s/10 (%s votes) - %s' % (name, year, rating, votes, genre)
Expand Down

0 comments on commit ecee75b

Please sign in to comment.