Skip to content

Commit

Permalink
Only manipulate thumbnail_url attribute if it's not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jochensengier authored Sep 27, 2019
1 parent 9f9280d commit e8db3ec
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/parsers/Vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ public function getVideoInfoWithAPI($id)
$response = VideoPlatformsParser::HTTPGet($url);
$json = json_decode($response, true);

$json['thumbnail_url'] = str_replace('_295x166', '', $json['thumbnail_url']);

return [
'id' => $id,
'title' => $json['title'],
'description' => ! empty($json['description']) ? $json['description'] : null,
'thumbnail' => ! empty($json['thumbnail_url']) ? $json['thumbnail_url'] : null,
'thumbnail' => ! empty($json['thumbnail_url']) ? str_replace('_295x166', '', $json['thumbnail_url']) : null,
'duration' => ! empty($json['duration']) ? $json['duration'] : 0,
'api' => true
];
Expand Down

0 comments on commit e8db3ec

Please sign in to comment.