Skip to content

Commit a376225

Browse files
committed
parseApplication(): use precise data for ratings/votes if available
1 parent a447308 commit a376225

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

google-play.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ public function parseApplication($packageName, $lang='en_US', $loc='US') {
211211
if ( empty($values["summary"]) && !empty($data["description"]) ) $values["summary"] = $data["description"];
212212
if (isset($data["contentRating"])) $values["contentRating"] = $data["contentRating"];
213213
else $values["contentRating"] = "";
214+
if ( isset($data["aggregateRating"]) ) {
215+
if ( !empty($data["aggregateRating"]["ratingValue"]) ) $values["rating"] = $data["aggregateRating"]["ratingValue"];
216+
if ( !empty($data["aggregateRating"]["ratingCount"]) ) $values["votes"] = $data["aggregateRating"]["ratingCount"];
217+
}
214218

215219
$limit = 5; $proto = '';
216220
while ( empty($proto) && $limit > 0 ) { // sometimes protobuf is missing, but present again on subsequent call

0 commit comments

Comments
 (0)