From 6fc365898864c958804125ef099018cefed2b3d8 Mon Sep 17 00:00:00 2001 From: alxlaxv <35723598+alxlaxv@users.noreply.github.com> Date: Fri, 19 Oct 2018 23:34:05 +0200 Subject: [PATCH] Update Sonarr.php --- app/SupportedApps/Sonarr.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/SupportedApps/Sonarr.php b/app/SupportedApps/Sonarr.php index 3f65375b..fc729650 100644 --- a/app/SupportedApps/Sonarr.php +++ b/app/SupportedApps/Sonarr.php @@ -52,7 +52,7 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats { $html = ' '; return json_encode(['status' => $active, 'html' => $html]); @@ -94,7 +94,11 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats { $api_url = $url.'/api/queue?apikey='.$config->apiKey.'&pageSize=1'; $client = new Client(['http_errors' => false, 'timeout' => 15, 'connect_timeout' => 15]); $res = $client->request('GET', $api_url); - $queue = sizeof($res->getBody()); + $queue = 0; + if (empty($res->getBody())) + { + $queue = sizeof($res->getBody()); + } return $queue; } }