From 43ad4b72bd16b8cba6769110c06649aa63df4f2e Mon Sep 17 00:00:00 2001 From: alxlaxv <35723598+alxlaxv@users.noreply.github.com> Date: Fri, 19 Oct 2018 23:24:40 +0200 Subject: [PATCH] Update Sonarr.php --- app/SupportedApps/Sonarr.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/SupportedApps/Sonarr.php b/app/SupportedApps/Sonarr.php index 209b0ddf..6853421a 100644 --- a/app/SupportedApps/Sonarr.php +++ b/app/SupportedApps/Sonarr.php @@ -76,8 +76,10 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats { $url = rtrim($url, '/'); $api_url = $url.'/api/wanted/missing?apikey='.$config->apiKey.'&pageSize=1'; $client = new Client(['http_errors' => false, 'timeout' => 15, 'connect_timeout' => 15]); - $res = json_decode($client->request('GET', $api_url)); - $missing = $res->totalRecords; + $res = $client->request('GET', $api_url); + echo $res; + $json = json_decode($res); + $missing = $json->totalRecords; if (empty($missing)) { $missing = 0; @@ -92,7 +94,10 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats { $url = rtrim($url, '/'); $api_url = $url.'/api/queue?apikey='.$config->apiKey.'&pageSize=1'; $client = new Client(['http_errors' => false, 'timeout' => 15, 'connect_timeout' => 15]); - $queue = sizeof($client->request('GET', $api_url)); + $queue = $client->request('GET', $api_url)); + $res = $client->request('GET', $api_url); + echo $res; + $queue = sizeof($res); return $queue; } }