|
@@ 52-54 (lines=3) @@
|
| 49 |
|
private function normalizeSearchVideosResponse($response) |
| 50 |
|
{ |
| 51 |
|
$response = json_decode($response, true); |
| 52 |
|
if (!is_array($response) || !array_key_exists('result', $response) || !array_key_exists('total', $response)) { |
| 53 |
|
throw new Exception('Invalid response from search endpoint'); |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
$response['totalCount'] = $response['total']; |
| 57 |
|
$response['videos'] = $response['result']; |
|
@@ 95-97 (lines=3) @@
|
| 92 |
|
private function normalizeSearchChannelsResponse($response) |
| 93 |
|
{ |
| 94 |
|
$response = json_decode($response, true); |
| 95 |
|
if (!is_array($response) || !array_key_exists('result', $response) || !array_key_exists('total', $response)) { |
| 96 |
|
throw new Exception('Invalid response from search endpoint'); |
| 97 |
|
} |
| 98 |
|
|
| 99 |
|
$response['totalCount'] = $response['total']; |
| 100 |
|
$response['channels'] = $response['result']; |