Skip to content

Commit

Permalink
Merge pull request #3 from jorisnoo/fix-vimeo-stats
Browse files Browse the repository at this point in the history
fix: fallback value if no stats are present
  • Loading branch information
jamesmacwhite committed Jun 5, 2023
2 parents ef6cb54 + 3ec5fbe commit 7c202fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gateways/Vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ private function parseCollectionAlbum($data): array
$collection['id'] = substr($data['uri'], strpos($data['uri'], '/albums/') + \strlen('/albums/'));
$collection['url'] = $data['uri'];
$collection['title'] = $data['name'];
$collection['totalVideos'] = $data['stats']['videos'];
$collection['totalVideos'] = $data['stats']['videos'] ?? 0;

return $collection;
}
Expand Down Expand Up @@ -524,7 +524,7 @@ private function parseCollectionChannel($data): array
$collection['id'] = substr($data['uri'], strpos($data['uri'], '/channels/') + \strlen('/channels/'));
$collection['url'] = $data['uri'];
$collection['title'] = $data['name'];
$collection['totalVideos'] = $data['stats']['videos'];
$collection['totalVideos'] = $data['stats']['videos'] ?? 0;

return $collection;
}
Expand Down

0 comments on commit 7c202fd

Please sign in to comment.