Closed Bug 608539 Opened 15 years ago Closed 15 years ago

API is returning incorrect ratings for items

Categories

(addons.mozilla.org Graveyard :: API, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
5.12.2

People

(Reporter: mossop, Assigned: clouserw)

References

()

Details

This extension shows a rating of 5 on AMO: https://addons.mozilla.org/de/firefox/addon/9018/ The API says it has a rating of 3 though: https://services.addons.mozilla.org/en-US/firefox/api/1.5/addon/9018 I briefly recall during the original rating some back and forth about how the rating was storing out of 10 in the database and scaled for display or something, maybe something is broken one way or another with that? Or this could be something else entirely.
bug 417442 is what I was thinking of before, looks like that is likely unrelated
This addon's numbers: averagerating: 5.0 bayesianrating: 2.86211 Average is a simple average. The bayesian is a complicated algorithm that deals with number of reviews and how it relates to other add-ons. On the add-ons site, we use the bayesian rating for doing any sorting or "where should this add-on appear" calculations. When we're displaying a star rating, we show the average. For the API, it appears we're giving you the rounded up version of the bayesian rating which feels wrong (we should never be rounding the bayesian rating), but if you're using it for sorting anywhere, it could begin to give bad results. Is the API using it anywhere to sort or just to display? Should we offer you both?
(In reply to comment #2) > For the API, it appears we're giving you the rounded up version of the bayesian > rating which feels wrong (we should never be rounding the bayesian rating), but > if you're using it for sorting anywhere, it could begin to give bad results. > > Is the API using it anywhere to sort or just to display? Should we offer you > both? We don't currently do any sorting based on the ratings. That might be a nice feature in the future but for now I think the API should just be giving us the averagerating for display
Assignee: nobody → clouserw
Target Milestone: --- → 5.12.2
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Do we have a staging site for s.amo we could use to verify the fix?
Hm, do we still round values? The video download helper should have a rating of 4 but in the API it's listed with 5 stars: https://addons.allizom.org/en-US/firefox/addon/3006/ https://addons.allizom.org/en-US/firefox/api/1.5/addon/3006 Also a question regarding automated tests. Which framework are you using for testing the API? Are there already tests in place?
We didn't round values when I closed the bug, but http://github.com/jbalogh/zamboni/commit/3c650b5a9f06990a66591894a1a56ebf6e6b7b89added in a ceil() because we used to have it. davedash said he'd remove it. The commits linked in this bug will show you the unit tests, it's django+nose.
This bug looks fixed to me. I have checked for the following add-ons: Adblock Plus, Noscript,Persona Plus, Easy Youtube Downloader, Aniweather, Youtube, Yoono, Video Download Helper, Download Status bar, Firebug ,Fox tab and NASA. Henrik, can you confirm?
Yes, looks good. Marking as verified fixed on preview. Thanks.
Status: RESOLVED → VERIFIED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.