| 
						
						
							
								
							
						
						
					 | 
					@ -51,8 +51,8 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        $active = 'active'; | 
					 | 
					 | 
					        $active = 'active'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        $html = ' | 
					 | 
					 | 
					        $html = ' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        <ul class="livestats"> | 
					 | 
					 | 
					        <ul class="livestats"> | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            <li><span class="title">Wanted: ' . $this->getWanted() . '</span></li> | 
					 | 
					 | 
					            <li><span class="title">Missing: ' . $this->getMissing() . '</span></li> | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            <li><span class="title">Activity: ' . $this->getQueue() . '</span></li> | 
					 | 
					 | 
					             | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        </ul> | 
					 | 
					 | 
					        </ul> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        '; | 
					 | 
					 | 
					        '; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return json_encode(['status' => $active, 'html' => $html]); | 
					 | 
					 | 
					        return json_encode(['status' => $active, 'html' => $html]); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -69,7 +69,7 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return $res; | 
					 | 
					 | 
					        return $res; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    public function getWanted() | 
					 | 
					 | 
					    public function getMissing() | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    { | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        $config = $this->config; | 
					 | 
					 | 
					        $config = $this->config; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        $url = $config->url; | 
					 | 
					 | 
					        $url = $config->url; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -77,12 +77,12 @@ class Sonarr implements Contracts\Applications, Contracts\Livestats | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        $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]); | 
					 | 
					 | 
					        $client = new Client(['http_errors' => false, 'timeout' => 15, 'connect_timeout' => 15]); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        $res = json_decode($client->request('GET', $api_url)); | 
					 | 
					 | 
					        $res = json_decode($client->request('GET', $api_url)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        $wanted = $res->totalRecords; | 
					 | 
					 | 
					        $missing = $res->totalRecords; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (empty($wanted)) | 
					 | 
					 | 
					        if (empty($missing)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        { | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            $wanted = 0; | 
					 | 
					 | 
					            $missing = 0; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        return $wanted; | 
					 | 
					 | 
					        return $missing; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public function getQueue() | 
					 | 
					 | 
					    public function getQueue() | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |