diff --git a/app/CallingAllPapers/ConferenceImporter.php b/app/CallingAllPapers/ConferenceImporter.php index d7cb338d..61993145 100644 --- a/app/CallingAllPapers/ConferenceImporter.php +++ b/app/CallingAllPapers/ConferenceImporter.php @@ -8,7 +8,6 @@ use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; use DateTime; -use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Validator; class ConferenceImporter @@ -73,7 +72,6 @@ public function import(Event $event) $this->updateConferenceFromCallingAllPapersEvent($conference, $event); if (! $conference->latitude && ! $conference->longitude && $conference->location) { - Log::debug('Looking up geocode for conference ' . $conference->id . ' with location of ' . $conference->location); $this->geocodeLatLongFromLocation($conference); } @@ -88,13 +86,16 @@ public function import(Event $event) private function updateConferenceFromCallingAllPapersEvent(Conference $conference, Event $event) { + if ($event->location != $conference->location) { + $conference->latitude = $this->nullifyInvalidLatLong($event->latitude, $event->longitude); + $conference->longitude = $this->nullifyInvalidLatLong($event->longitude, $event->latitude); + } + $conference->title = trim($event->name); $conference->description = trim($event->description); $conference->url = trim($event->eventUri); $conference->cfp_url = $event->uri; $conference->location = $event->location; - $conference->latitude = $this->nullifyInvalidLatLong($event->latitude, $event->longitude); - $conference->longitude = $this->nullifyInvalidLatLong($event->longitude, $event->latitude); $conference->starts_at = $event->dateEventStart; $conference->ends_at = $event->dateEventEnd; $conference->cfp_starts_at = $event->dateCfpStart; diff --git a/app/Services/Geocoder.php b/app/Services/Geocoder.php index d3113805..d092477f 100644 --- a/app/Services/Geocoder.php +++ b/app/Services/Geocoder.php @@ -5,7 +5,6 @@ use App\Casts\Coordinates; use App\Exceptions\InvalidAddressGeocodingException; use Illuminate\Support\Facades\Http; -use Illuminate\Support\Facades\Log; class Geocoder { @@ -18,7 +17,6 @@ public function geocode(string $address): Coordinates $response = $this->requestGeocoding($address); if (! count($response['results'])) { - Log::debug('Caching address as invalid: [' . $address . ']'); cache()->set('invalid-address::' . md5($address), true); throw new InvalidAddressGeocodingException(); }