mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Init dxcc class only once during import
This commit is contained in:
@@ -8,6 +8,7 @@ class Logbook_model extends CI_Model {
|
||||
|
||||
private $station_result = [];
|
||||
private $spot_status_cache = []; // In-memory cache for DX cluster spot statuses
|
||||
private $dxcc_object;
|
||||
|
||||
public function __construct() {
|
||||
$this->oop_populate_modes();
|
||||
@@ -194,7 +195,7 @@ class Logbook_model extends CI_Model {
|
||||
$this->input->post('continent') == "");
|
||||
|
||||
if ($needs_dxcc_lookup) {
|
||||
$dxccobj = new Dxcc($date);
|
||||
$dxccobj = new Dxcc(null);
|
||||
$dxcc = $dxccobj->dxcc_lookup(strtoupper(trim($callsign)), $datetime);
|
||||
}
|
||||
|
||||
@@ -4913,13 +4914,17 @@ class Logbook_model extends CI_Model {
|
||||
$entity = $this->get_entity($record['dxcc']);
|
||||
$dxcc = array($record['dxcc'] ?? '', $entity['name'] ?? '');
|
||||
} else {
|
||||
$dxccobj = new Dxcc(null);
|
||||
$dxcclookupresult = $dxccobj->dxcc_lookup($record['call'], $time_off);
|
||||
if ($this->dxcc_object == null) {
|
||||
$this->dxcc_object = new Dxcc(null);
|
||||
}
|
||||
$dxcclookupresult = $this->dxcc_object->dxcc_lookup($record['call'], $time_off);
|
||||
$dxcc = array($dxcclookupresult['adif'], $dxcclookupresult['entity'], $dxcclookupresult['cqz'], $dxcclookupresult['cont']);
|
||||
}
|
||||
} else {
|
||||
$dxccobj = new Dxcc(null);
|
||||
$dxcclookupresult = $dxccobj->dxcc_lookup($record['call'], $time_off);
|
||||
if ($this->dxcc_object == null) {
|
||||
$this->dxcc_object = new Dxcc(null);
|
||||
}
|
||||
$dxcclookupresult = $this->dxcc_object->dxcc_lookup($record['call'], $time_off);
|
||||
$dxcc = array($dxcclookupresult['adif'], $dxcclookupresult['entity'], $dxcclookupresult['cqz'], $dxcclookupresult['cont']);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -92,6 +92,7 @@ class Dxcc {
|
||||
$row['cqz'] = 0;
|
||||
$row['long'] = '0';
|
||||
$row['lat'] = '0';
|
||||
$row['cont'] = null;
|
||||
return $row;
|
||||
} else {
|
||||
$call = $result . "AA";
|
||||
@@ -127,7 +128,14 @@ class Dxcc {
|
||||
}
|
||||
}
|
||||
|
||||
return array("Not Found", "Not Found");
|
||||
return array(
|
||||
'adif' => 0,
|
||||
'entity' => '- NONE ',
|
||||
'cqz' => '0',
|
||||
'long' => '0',
|
||||
'lat' => '0',
|
||||
'cont' => null
|
||||
);
|
||||
}
|
||||
|
||||
function wpx($testcall, $i) {
|
||||
|
||||
Reference in New Issue
Block a user