Bug 1441841 Use the right count for ratings link in addon details
MozReview-Commit-ID: KcXiABRbWof
--- a/toolkit/mozapps/extensions/internal/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm
@@ -642,17 +642,17 @@ var AddonRepository = {
shot.caption);
});
}
addon.contributionURL = aEntry.contributions_url;
if (typeof aEntry.ratings == "object") {
addon.averageRating = Math.min(5, aEntry.ratings.average);
- addon.reviewCount = aEntry.ratings.count;
+ addon.reviewCount = aEntry.ratings.text_count;
}
addon.reviewURL = aEntry.ratings_url;
if (aEntry.last_updated) {
addon.updateDate = new Date(aEntry.last_updated);
}
addon.icons = aEntry.icons || {};
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_cache.json
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_cache.json
@@ -34,17 +34,18 @@
}
],
"summary": "Repo Add-on 1 - Description<br>Second line",
"description": "<p>Repo Add-on 1 - Full Description & some extra</p>",
"icons": {
"32": "http://localhost/repo/1/icon.png"
},
"ratings": {
- "count": 1111,
+ "count": 1234,
+ "text_count": 1111,
"average": 1
},
"homepage": "http://localhost/repo/1/homepage.html",
"support_url": "http://localhost/repo/1/support.html",
"contributions_url": "http://localhost/repo/1/meetDevelopers.html",
"ratings_url": "http://localhost/repo/1/review.html",
"weekly_downloads": 3331,
"last_updated": "1970-01-01T00:00:09Z"
@@ -90,17 +91,18 @@
},
{
"image_url": "http://localhost:4444/repo/2/secondFull.png",
"thumbnail_url": "http://localhost:4444/repo/2/secondThumbnail.png",
"caption": "Repo Add-on 2 - Second Caption"
}
],
"ratings": {
- "count": 1112,
+ "count": 2223,
+ "text_count": 1112,
"average": 2
},
"homepage": "http://localhost/repo/2/homepage.html",
"support_url": "http://localhost/repo/2/support.html",
"contributions_url": "http://localhost/repo/2/meetDevelopers.html",
"ratings_url": "http://localhost/repo/2/review.html",
"weekly_downloads": 3332,
"last_updated": "1970-01-01T00:00:09Z"
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_getAddonsByIDs.json
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_getAddonsByIDs.json
@@ -44,17 +44,18 @@
},
{
"caption": "Caption 2 - 1",
"image_url": "http://localhost:%PORT%/full2-1.png",
"thumbnail_url": "http://localhost:%PORT%/thumbnail2-1.png"
}
],
"ratings": {
- "count": 1111,
+ "count": 1234,
+ "text_count": 1111,
"average": 4
},
"ratings_url": "http://localhost:%PORT%/review1.html",
"support_url": "http://localhost:%PORT%/support1.html",
"contributions_url": "http://localhost:%PORT%/contribution1.html",
"weekly_downloads": 3333,
"last_updated": "2010-02-01T14:04:05Z"
},