fixed a bug in simplefle and added cache clearing

This commit is contained in:
HB9HIL
2024-11-11 20:25:59 +01:00
parent 94696a51e1
commit 4fc175c0fb
3 changed files with 20 additions and 9 deletions

View File

@@ -87,11 +87,11 @@ class SimpleFLE extends CI_Controller {
$one_result = $this->logbook_model->import($qso, $qso['station_id']);
// if the returner is not empty we have an error and should log it
if ($result != '' && strpos(json_encode($one_result), 'Duplicate for') == false) {
log_message('error', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Error: ' . json_encode($result));
if (json_encode($result) != '[]' && strpos(json_encode($one_result), __("Duplicate for")) == false) {
log_message('error', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Error: ' . json_encode($one_result));
}
if (strpos(json_encode($one_result), 'Duplicate for') !== false) {
log_message('debug', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Warning: ' . json_encode($result));
if (strpos(json_encode($one_result), __("Duplicate for")) !== false) {
log_message('debug', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Warning: ' . json_encode($one_result));
}
if ($one_result != '') {
@@ -99,6 +99,12 @@ class SimpleFLE extends CI_Controller {
}
}
// Also clean up static map images
if (!$this->load->is_loaded('staticmap_model')) {
$this->load->model('staticmap_model');
}
$this->staticmap_model->remove_static_map_image($qso['station_id']);
if (empty($result)) {
echo "success";
} else {