diff --git a/FreshRSS/FreshRSS.php b/FreshRSS/FreshRSS.php index d598ae6cf..ea68c7528 100644 --- a/FreshRSS/FreshRSS.php +++ b/FreshRSS/FreshRSS.php @@ -27,7 +27,7 @@ class FreshRSS extends \App\SupportedApps implements \App\EnhancedApps { if($res->getStatusCode() == 200) { $data = json_decode($res->getBody()); - if($data->auth == 1){ + if($data != null && $data->auth === 1){ echo "Welcome " . $this->config->username . ", you are connected to API v".$data->api_version; } } @@ -46,8 +46,10 @@ class FreshRSS extends \App\SupportedApps implements \App\EnhancedApps { $res = parent::execute($this->url('api/fever.php?api&unread_item_ids'), $attrs, $this->clientVars, 'POST'); if($res->getStatusCode() == 200) { $body = json_decode($res->getBody()); - $unread = count(explode(",", $body->unread_item_ids)); - $data['unread'] = $unread ?? 0; + if($data->auth === 1){ + $unread = count(explode(",", $body->unread_item_ids)); + $data['unread'] = $unread ?? 0; + } } return parent::getLiveStats($status, $data); @@ -55,7 +57,7 @@ class FreshRSS extends \App\SupportedApps implements \App\EnhancedApps { public function url($endpoint) { - $api_url = parent::normaliseurl($this->config->override_url).$endpoint; + $api_url = parent::normaliseurl($this->config->url).$endpoint; return $api_url; } @@ -63,4 +65,4 @@ class FreshRSS extends \App\SupportedApps implements \App\EnhancedApps { { return md5($this->config->username.":".$this->config->apikey); } -} +} \ No newline at end of file diff --git a/FreshRSS/config.blade.php b/FreshRSS/config.blade.php index 68a6d3944..50b3e0d3f 100644 --- a/FreshRSS/config.blade.php +++ b/FreshRSS/config.blade.php @@ -2,7 +2,7 @@