magicbug / Cloudlog

Web based amateur radio logging application built using PHP & MySQL supports general station logging tasks from HF to Microwave with supporting applications to support CAT control.
http://www.cloudlog.co.uk
MIT License
447 stars 189 forks source link

eQSL upload filtering isn't working for locations without an eQSL nickname #2004

Closed ofadam closed 1 year ago

ofadam commented 1 year ago

Currently on the dev branch, QSOs that don't have an eQSL nickname set are still being uploaded. The growing list of QSOs for these locations eventually results in most web hosts timing out while trying to upload.

This commit didn't seem to fix the issue: https://github.com/magicbug/Cloudlog/commit/6f8d07e1cdb3f584e37492fc5c870aec78077d36

This especially comes into play with POTA activators like myself, who are often activating from a long list of gridsquares. Yet eQSL doesn't properly support multiple locations easily, necessitating that not all QSOs be uploaded to them.

AndreasK79 commented 1 year ago

Could you edit logbook_model.php and change eqsl_not_yet_sent function to the following:

function eqsl_not_yet_sent() {
  $this->db->select('station_profile.*, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_COMMENT, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_PROP_MODE, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_SAT_MODE, '.$this->config->item('table_name').'.COL_QSLMSG');
  $this->db->from('station_profile');
  $this->db->join($this->config->item('table_name'),'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
  $this->db->group_start();
  $this->db->where('station_profile.eqslqthnickname !=', '');
  $this->db->or_where('station_profile.eqslqthnickname is not null');
  $this->db->group_end();
  $this->db->where($this->config->item('table_name').'.COL_CALL !=', '');
  $this->db->where($this->config->item('table_name').'.COL_EQSL_QSL_SENT !=', 'Y');
  $this->db->group_start();
  $this->db->where($this->config->item('table_name').'.COL_EQSL_QSL_SENT !=', 'I');
  $this->db->or_where(array($this->config->item('table_name').'.COL_EQSL_QSL_SENT' => NULL));
  $this->db->group_end();

 return $this->db->get();
}

If that solves your problem, I'll push it to the dev branch.

ofadam commented 1 year ago

This seems to have worked like a charm! Thank you so much!

AndreasK79 commented 1 year ago

Thanks for testing. I've pushed the fix to dev now.

ofadam commented 1 year ago

Whoops! Apparently I spoke too soon. While this fix stopped QSOs without an eQSL nickname set from being uploaded, it also seems to be preventing QSOs with an eQSL nickname set from being queued for upload.