diff --git a/app/Http/Controllers/TrackerController.php b/app/Http/Controllers/TrackerController.php index b443bd2..5dfa665 100644 --- a/app/Http/Controllers/TrackerController.php +++ b/app/Http/Controllers/TrackerController.php @@ -145,7 +145,6 @@ class TrackerController extends Controller // Otherwise, download the trip data from the Wayward API. if ($forceDownload) { Log::debug("Forcing download for '{$tripFileName}'."); - Storage::disk('local')->delete($tripFileName); } else { Log::debug("No cached trip file found for '{$tripFileName}'."); } @@ -169,7 +168,7 @@ class TrackerController extends Controller Storage::disk('local')->put($tripFileName, json_encode($data)); } else { $cachedData = json_decode(Storage::disk('local')->get($tripFileName)); - if (end($data->checkins)->date !== end($cachedData->checkins)->date) { + if ($data->trip->updated_at !== $cachedData->trip->updated_at) { Log::debug( "Cached trip file '" . $tripFileName . diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index 08267a5..c7435a9 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -59,7 +59,7 @@ attribution: 'OpenStreetMap' }).addTo(map); - @for($idx = 0; $idx <= count($trip->locations); $idx += 99) + @for($idx = 0; $idx <= count($trip->locations); $idx += 100) /* * Populate the route line. */