Skip to content

Commit

Permalink
parseApplication(): use precise data for ratings/votes if available
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzySoft committed Jul 2, 2022
1 parent a447308 commit a376225
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions google-play.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ public function parseApplication($packageName, $lang='en_US', $loc='US') {
if ( empty($values["summary"]) && !empty($data["description"]) ) $values["summary"] = $data["description"];
if (isset($data["contentRating"])) $values["contentRating"] = $data["contentRating"];
else $values["contentRating"] = "";
if ( isset($data["aggregateRating"]) ) {
if ( !empty($data["aggregateRating"]["ratingValue"]) ) $values["rating"] = $data["aggregateRating"]["ratingValue"];
if ( !empty($data["aggregateRating"]["ratingCount"]) ) $values["votes"] = $data["aggregateRating"]["ratingCount"];
}

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

0 comments on commit a376225

Please sign in to comment.