Merge pull request #969 from AndreasK79/import_speedup
[ADIF Import] Reworking the logic for fetching the QRZ API Key, skips…
这个提交包含在:
当前提交
e3ba7411aa
共有 1 个文件被更改,包括 17 次插入 和 13 次删除
|
|
@ -380,20 +380,24 @@ class Logbook_model extends CI_Model {
|
||||||
|
|
||||||
$last_id = $this->db->insert_id();
|
$last_id = $this->db->insert_id();
|
||||||
|
|
||||||
$result = $this->exists_qrz_api_key($data['station_id']);
|
// No point in fetching qrz api key and qrzrealtime setting if we're skipping the export
|
||||||
|
if (!$skipexport) {
|
||||||
|
|
||||||
// Push qso to qrz if apikey is set, and realtime upload is enabled, and we're not importing an adif-file
|
$result = $this->exists_qrz_api_key($data['station_id']);
|
||||||
if (isset($result->qrzapikey) && $result->qrzrealtime == 1 && !$skipexport) {
|
|
||||||
$CI =& get_instance();
|
|
||||||
$CI->load->library('AdifHelper');
|
|
||||||
$qso = $this->get_qso($last_id)->result();
|
|
||||||
|
|
||||||
$adif = $CI->adifhelper->getAdifLine($qso[0]);
|
// Push qso to qrz if apikey is set, and realtime upload is enabled, and we're not importing an adif-file
|
||||||
$result = $this->push_qso_to_qrz($result->qrzapikey, $adif);
|
if (isset($result->qrzapikey) && $result->qrzrealtime == 1) {
|
||||||
if ($result['status'] == 'OK') {
|
$CI =& get_instance();
|
||||||
$this->mark_qrz_qsos_sent($last_id);
|
$CI->load->library('AdifHelper');
|
||||||
}
|
$qso = $this->get_qso($last_id)->result();
|
||||||
}
|
|
||||||
|
$adif = $CI->adifhelper->getAdifLine($qso[0]);
|
||||||
|
$result = $this->push_qso_to_qrz($result->qrzapikey, $adif);
|
||||||
|
if ($result['status'] == 'OK') {
|
||||||
|
$this->mark_qrz_qsos_sent($last_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -2305,4 +2309,4 @@ function validateADIFDate($date, $format = 'Ymd')
|
||||||
$d = DateTime::createFromFormat($format, $date);
|
$d = DateTime::createFromFormat($format, $date);
|
||||||
return $d && $d->format($format) == $date;
|
return $d && $d->format($format) == $date;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用