Metadata download: Round the downloaded ratings so that, for example, 3.6 stars becomes 4 stars instead of 3 stars. Fixes #1335696 [Amazon Ratings metadata download only rounds down](https://bugs.launchpad.net/calibre/+bug/1335696)

This commit is contained in:
Kovid Goyal 2014-06-30 13:18:31 +05:30
parent dd324b1ce5
commit c47ed6666a

View File

@ -289,7 +289,7 @@ class ISBNMerge(object):
if rating and rating > 0 and rating <= 5: if rating and rating > 0 and rating <= 5:
ratings.append(rating) ratings.append(rating)
if ratings: if ratings:
ans.rating = sum(ratings)/len(ratings) ans.rating = int(round(sum(ratings)/len(ratings)))
# Smallest language is likely to be valid # Smallest language is likely to be valid
ans.language = self.length_merge('language', results, ans.language = self.length_merge('language', results,