From c47ed6666ab32d56a1ce1108b68b6b74d0784adc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 30 Jun 2014 13:18:31 +0530 Subject: [PATCH] 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) --- src/calibre/ebooks/metadata/sources/identify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/metadata/sources/identify.py b/src/calibre/ebooks/metadata/sources/identify.py index 96f214ca95..ba32b5348d 100644 --- a/src/calibre/ebooks/metadata/sources/identify.py +++ b/src/calibre/ebooks/metadata/sources/identify.py @@ -289,7 +289,7 @@ def merge(self, results, min_year, do_asr=True): if rating and rating > 0 and rating <= 5: ratings.append(rating) if ratings: - ans.rating = sum(ratings)/len(ratings) + ans.rating = int(round(sum(ratings)/len(ratings))) # Smallest language is likely to be valid ans.language = self.length_merge('language', results,