Merge pull request #2371 from phl0/reenteredBirds

Re-entered birds
This commit is contained in:
Florian (DF2ET)
2025-10-02 17:08:25 +02:00
committed by GitHub
5 changed files with 11 additions and 4 deletions

View File

@@ -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);

View File

@@ -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();

View File

@@ -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
@@ -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
";

View File

@@ -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);
@@ -428,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);

View File

@@ -97,7 +97,7 @@
echo '</td>';
?>
<?php echo '<td style="text-align: center; vertical-align: middle;">';
if ($sat->updated != null) {
if ($sat->tle != null) {
echo '<button class="btn btn-sm btn-success" onclick="editTle(' . $sat->id . ');" data-bs-toggle="tooltip" title="Last TLE updated was ' . date($custom_date_format . " H:i", strtotime($sat->updated)) . '">'.__("Yes").'</i></button>';
} else {
echo '<button class="btn btn-sm btn-danger" onclick="editTle(' . $sat->id . ');">'.__("No").'</button>';