From 39a6660d694620325f343144c49a256633189b08 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 2 Oct 2025 14:55:12 +0200 Subject: [PATCH 1/5] Clear TLEs in table before update so that re-entered birds get their TLEs removed --- application/models/Update_model.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/models/Update_model.php b/application/models/Update_model.php index 1ba2016f4..758999b77 100644 --- a/application/models/Update_model.php +++ b/application/models/Update_model.php @@ -370,6 +370,11 @@ class Update_model extends CI_Model { $starttime = $mtime; $this->update_norad_ids(); + + // Clear all TLE so that reentered birds disappear from planner and path prediction + $sql = "UPDATE `tle` SET `tle` = NULL WHERE 1;"; + $this->db->query($sql); + $url = 'https://www.amsat.org/tle/dailytle.txt'; $curl = curl_init($url); From fdbd7955e8967ca006c3b75dfcd8afe764bb12b4 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 2 Oct 2025 15:10:11 +0200 Subject: [PATCH 2/5] Skip calculations for sats without TLE --- application/controllers/Satellite.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/controllers/Satellite.php b/application/controllers/Satellite.php index a8454045e..129669559 100644 --- a/application/controllers/Satellite.php +++ b/application/controllers/Satellite.php @@ -431,6 +431,9 @@ class Satellite extends CI_Controller { $filtered=[]; foreach ($sat_tles as $sat_tle) { + if ($sat_tle->tle == null) { + continue; + } try { $temp = preg_split('/\n/', $sat_tle->tle); From 3b007221773739acd0cf3f07bbff29e47d587520 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 2 Oct 2025 15:39:20 +0200 Subject: [PATCH 3/5] Use tle column for decision wether TLEs exist --- application/models/Satellite_model.php | 2 +- application/views/satellite/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Satellite_model.php b/application/models/Satellite_model.php index 527fd700b..6671df805 100644 --- a/application/models/Satellite_model.php +++ b/application/models/Satellite_model.php @@ -3,7 +3,7 @@ class Satellite_model extends CI_Model { function get_all_satellites() { - $sql = "select satellite.id, satellite.name as satname, group_concat(distinct satellitemode.name separator ', ') as modename, satellite.displayname, satellite.orbit, satellite.lotw as lotw, tle.updated + $sql = "select satellite.id, satellite.name as satname, group_concat(distinct satellitemode.name separator ', ') as modename, satellite.displayname, satellite.orbit, satellite.lotw as lotw, tle.updated, tle.tle from satellite left outer join satellitemode on satellite.id = satellitemode.satelliteid left outer join tle on satellite.id = tle.satelliteid diff --git a/application/views/satellite/index.php b/application/views/satellite/index.php index 993c45e31..4167a7c7f 100644 --- a/application/views/satellite/index.php +++ b/application/views/satellite/index.php @@ -97,7 +97,7 @@ echo ''; ?> '; - if ($sat->updated != null) { + if ($sat->tle != null) { echo ''; } else { echo ''; From 41c9f281d2d8634bd8688c3c1e04642c1ee199d2 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 2 Oct 2025 15:42:47 +0200 Subject: [PATCH 4/5] SQL should check for empty TLEs indeed --- application/models/Satellite_model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/models/Satellite_model.php b/application/models/Satellite_model.php index 6671df805..46a7d0784 100644 --- a/application/models/Satellite_model.php +++ b/application/models/Satellite_model.php @@ -31,6 +31,7 @@ class Satellite_model extends CI_Model { $sql = "select satellite.id, satellite.name as satname, satellite.displayname as displayname, tle.tle from satellite join tle on satellite.id = tle.satelliteid + where tle is not NULL order by satellite.name "; From b7a1cd6665a53d041b1c0203642e77858d8fcdc2 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 2 Oct 2025 16:00:33 +0200 Subject: [PATCH 5/5] Remove deprecated (and non-effect) cURL option See https://php.watch/versions/8.4/CURLOPT_BINARYTRANSFER-deprecated --- application/libraries/Curl.php | 1 - application/models/Update_model.php | 1 - 2 files changed, 2 deletions(-) diff --git a/application/libraries/Curl.php b/application/libraries/Curl.php index 35a755242..9ff8dfd5d 100644 --- a/application/libraries/Curl.php +++ b/application/libraries/Curl.php @@ -100,7 +100,6 @@ class Curl { // Add the filepath $url .= $file_path; - $this->option(CURLOPT_BINARYTRANSFER, TRUE); $this->option(CURLOPT_VERBOSE, TRUE); return $this->execute(); diff --git a/application/models/Update_model.php b/application/models/Update_model.php index 758999b77..be088d5e4 100644 --- a/application/models/Update_model.php +++ b/application/models/Update_model.php @@ -433,7 +433,6 @@ class Update_model extends CI_Model { curl_setopt($curl, CURLOPT_FAILONERROR, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($curl, CURLOPT_BINARYTRANSFER,true); curl_setopt($curl, CURLOPT_TIMEOUT, 10); $response = curl_exec($curl);