From 5205184d6ede03d5a2a59a43cc440b0d0221a7d8 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Thu, 12 Dec 2019 00:15:09 -0600 Subject: [PATCH] damn lookup helper --- app/Library/Lookups/LookupHelper.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/app/Library/Lookups/LookupHelper.php b/app/Library/Lookups/LookupHelper.php index 0f9766932..4ac5332cc 100644 --- a/app/Library/Lookups/LookupHelper.php +++ b/app/Library/Lookups/LookupHelper.php @@ -7,6 +7,7 @@ use DB; use Log; //Library +use Seat\Eseye\Configuration; use Seat\Eseye\Exceptions\RequestFailedException; use App\Library\Esi\Esi; @@ -150,18 +151,20 @@ class LookupHelper { //Check our own database first $char = $this->LookupCharacter($charId, null); - //if the character was not found in the database, then get the information and store it in our database for later - if(!isset($char->id)) { - try { - $response = $this->esi->invoke('get', '/characters/{character_id}/', [ - 'character_id' => $charId, - ]); - } catch(RequestFailedException $e) { - Log::warning('Failed to get character information in GetCharacterInfo in Lookup'); - return null; - } + try { + $response = $this->esi->invoke('get', '/characters/{character_id}/', [ + 'character_id' => $charId, + ]); + } catch(RequestFailedException $e) { + Log::warning('Failed to get character information in GetCharacterInfo in Lookup'); + return null; + } - dd($response); + dd($response); + + //if the character was not found in the database, then get the information and store it in our database for later + if($char == null) { + //Store the character in our database $this->SaveCharacter($response, $charId);