Skip to content

Commit f26c112

Browse files
committed
Report found vs updated LoTW QSOs
Initialize and increment a $found_count while parsing ADIF records when import_check returns 'Found', then after batch update compute already-confirmed QSOs and expand the LoTW status message to include: Found, Updated, Already confirmed, and Gridsquares updated. Uses max(0, ...) to avoid negative already-confirmed values and updates the log output accordingly.
1 parent 9338ca4 commit f26c112

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

application/controllers/Lotw.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ private function loadFromFile($filepath, $display_view = "TRUE")
527527
$table = "";
528528
$batch_updates = array(); // Collect all updates for batch processing
529529
$table_rows = array(); // Collect table rows for later rendering
530+
$found_count = 0;
530531

531532
// First pass: collect all records for batch processing
532533
while($record = $this->adif_parser->get_record())
@@ -551,6 +552,7 @@ private function loadFromFile($filepath, $display_view = "TRUE")
551552
$status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['station_callsign']);
552553

553554
if($status[0] == "Found") {
555+
$found_count++;
554556
$state = isset($record['state']) ? $record['state'] : "";
555557
$qsl_gridsquare = isset($record['gridsquare']) ? $record['gridsquare'] : "";
556558
$qsl_vucc_grids = isset($record['vucc_grids']) ? $record['vucc_grids'] : "";
@@ -607,7 +609,8 @@ private function loadFromFile($filepath, $display_view = "TRUE")
607609
$lotw_status = "No updates";
608610
if (!empty($batch_updates)) {
609611
$result = $this->logbook_model->lotw_update_batch($batch_updates);
610-
$lotw_status = "Batch Updated: {$result['updated']} QSOs, {$result['gridsquare_updated']} gridsquares";
612+
$already_confirmed = max(0, $found_count - $result['updated']);
613+
$lotw_status = "Found: {$found_count} QSOs, Updated: {$result['updated']} QSOs, Already confirmed: {$already_confirmed} QSOs, Gridsquares updated: {$result['gridsquare_updated']}";
611614
log_message('info', 'LoTW Download: ' . $lotw_status);
612615
}
613616

0 commit comments

Comments
 (0)