From 36fc2420b42252e16a1a3a4a1ad6bd7feff91e73 Mon Sep 17 00:00:00 2001
From: alxlaxv <35723598+alxlaxv@users.noreply.github.com>
Date: Fri, 19 Oct 2018 22:35:45 +0200
Subject: [PATCH] Update Sonarr.php
---
app/SupportedApps/Sonarr.php | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/SupportedApps/Sonarr.php b/app/SupportedApps/Sonarr.php
index b982ae0d..d40c0deb 100644
--- a/app/SupportedApps/Sonarr.php
+++ b/app/SupportedApps/Sonarr.php
@@ -21,7 +21,7 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats {
$status = json_decode($res->getBody());
if(isset($status->version))
{
- echo 'Successfully connected to the API';
+ echo 'Successfully connected to Sonarr API version ' . $status->version;
}
else if(isset($status->error))
{
@@ -38,8 +38,8 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats {
$active = 'active';
$html = '
- - Wanted: '.$this->getWanted().'
- - Activity: '.$this->getQueue().'
+ - Wanted: ' . $this->getWanted() . '
+ - Activity: ' . $this->getQueue() . '
';
return json_encode(['status' => $active, 'html' => $html]);
@@ -49,7 +49,7 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats {
$config = $this->config;
$url = $config->url;
$url = rtrim($url, '/');
- $api_url = $url.'/api/system/status?apikey='.$config->apiKey;
+ $api_url = $url . '/api/system/status?apikey=' . $config->apiKey;
$client = new Client(['http_errors' => false, 'timeout' => 15, 'connect_timeout' => 15]);
$res = $client->request('GET', $api_url);
return $res;
@@ -59,7 +59,7 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats {
$config = $this->config;
$url = $config->url;
$url = rtrim($url, '/');
- $api_url = $url.'/api/wanted/missing?apikey='.$config->apiKey.'&pageSize=1';
+ $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));
$wanted = $res->totalRecords;
@@ -73,7 +73,7 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats {
$config = $this->config;
$url = $config->url;
$url = rtrim($url, '/');
- $api_url = $url.'/api/queue?apikey='.$config->apiKey.'&pageSize=1';
+ $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));
return $queue;