Comment 2 for bug 1245449

Dan Muresan (danmbox) wrote :

Thanks for replying Kovid. I'm not sure I've gotten the problem across.

I think parse_ratings() will pull a rating for a recommended book **as if it were a rating for the current book**. Therefore an unrated book B1 could be displayed in Calibre as having 3.6 stars, just because Amazon recommends B2 (on B1's page), and B2 happens to have 3.6 stars. This is misleading (and a bug).

If Amazon starts recommending a different book B3 (on B1's page) later on, Calibre might switch randomly to pulling B3's ratings, and suddenly show B1 as having 2.3 stars.

My xpath is in a sense "looser" than the ones in amazon.py -- it doesn't look for "crAvgStars" or "averageCustomerReviews" or any specific names which might vary. It only looks for a link with the text "N customer reviews" **which points back to the current book**. There's no easy way to fix the ratings XPath, because those don't link to any book, whereas the "N customer reviews" text always links to a book (and you can check its ASIN / ISBN)