diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index e06b02ff..d32a88e1 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -324,7 +324,7 @@ class Qrz extends CI_Controller { // Return the structured error array here too for consistency return ['status' => 'error', 'message' => $error_message]; } - $url = 'http://logbook.qrz.com/api'; // Correct URL + $url = 'https://logbook.qrz.com/api'; // Correct URL $post_data['KEY'] = $qrz_api_key; // Correct parameter $post_data['ACTION'] = 'FETCH'; // Correct parameter @@ -338,6 +338,9 @@ class Qrz extends CI_Controller { curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); // Correct - get response as string curl_setopt( $ch, CURLOPT_TIMEOUT, 300); // 5 minute timeout curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 30); // 30 second connection timeout + curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + curl_setopt($ch, CURLOPT_BUFFERSIZE, 128000); + curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate'); $content = curl_exec($ch); // Get raw content $curl_error = curl_error($ch); // Check for cURL errors diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 12a70150..0b7e394d 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4889,7 +4889,7 @@ class Logbook_model extends CI_Model foreach ($batch_data as $record) { $this->db->or_group_start(); // Start group for this record's AND conditions $this->db->where($this->config->item('table_name').'.COL_CALL', $record['call']); - $this->db->where($this->config->item('table_name').'.COL_TIME_ON', $record['time_on']); + $this->db->like($this->config->item('table_name').'.COL_TIME_ON', $record['time_on'], 'after'); $this->db->where($this->config->item('table_name').'.COL_BAND', $record['band']); $this->db->group_end(); // End group for this record's AND conditions } @@ -4902,7 +4902,8 @@ class Logbook_model extends CI_Model // Index DB results for faster lookup $indexed_results = []; foreach ($db_results as $row) { - $key = $row['COL_CALL'] . '|' . $row['COL_TIME_ON'] . '|' . $row['COL_BAND']; + $time = substr($row['COL_TIME_ON'], 0, 16); + $key = $row['COL_CALL'] . '|' . $time . '|' . $row['COL_BAND']; $indexed_results[$key] = $row['COL_PRIMARY_KEY']; } @@ -4920,7 +4921,7 @@ class Logbook_model extends CI_Model $update_batch_data[] = [ 'COL_PRIMARY_KEY' => $primary_key, 'COL_QRZCOM_QSO_DOWNLOAD_DATE' => $record['qsl_date'], - 'COL_QRZCOM_QSO_UPLOAD_STATUS' => $record['qsl_rcvd'] // Should be 'Y' if confirmed + 'COL_QRZCOM_QSO_DOWNLOAD_STATUS' => $record['qsl_rcvd'] // Should be 'Y' if confirmed ]; } @@ -4989,4 +4990,4 @@ function validateADIFDate($date, $format = 'Ymd') { $d = DateTime::createFromFormat($format, $date); return $d && $d->format($format) == $date; -} \ No newline at end of file +}