fix: QRZ.com download marked unconfirmed QSOs as confirmed
The operator's own fetch settles it. One record, both fields: <app_qrzlog_status:1>N <qrzcom_qso_download_status:1>Y QRZ says the QSO is NOT confirmed and sets the download field anyway — it marks what was handed back, not what was confirmed. OpsLog read it as a confirmation, so eighteen QSOs came back "UPDATED" and green, none of them confirmed on QRZ. The site's own logbook page shows them without a star. Only app_qrzlog_status = C counts now. The test that asserted otherwise is corrected and carries the real record. And the download now takes back what it wrongly gave: when QRZ explicitly says not-confirmed and our log says confirmed, the flag is cleared and reported on its own line. These QSOs count towards award slots, so leaving them green until someone noticed was not an option — and nothing else in the app would ever have undone them. Only on an explicit no: a record with no app_qrzlog_status is QRZ saying nothing, and silence is not a retraction.
This commit is contained in:
@@ -2506,6 +2506,23 @@ func (r *Repo) MarkQRZConfirmed(ctx context.Context, id int64, date string) erro
|
||||
return nil
|
||||
}
|
||||
|
||||
// ClearQRZConfirmed takes back a QRZ confirmation.
|
||||
//
|
||||
// Needed because OpsLog set some wrongly: it read qrzcom_qso_download_status,
|
||||
// which QRZ puts on everything it hands back, as QRZ's confirmation. Those
|
||||
// QSOs count towards award slots, so leaving them green until the operator
|
||||
// notices is not an option — and nothing else in the app would ever undo them.
|
||||
func (r *Repo) ClearQRZConfirmed(ctx context.Context, id int64) error {
|
||||
_, err := r.db.ExecContext(ctx,
|
||||
`UPDATE qso SET qrzcom_qso_download_status = 'N', qrzcom_qso_download_date = NULL,
|
||||
updated_at = ? WHERE id = ?`,
|
||||
db.NowISO(), id)
|
||||
if err != nil {
|
||||
return fmt.Errorf("clear qrz confirmed %d: %w", id, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarkEQSLConfirmed stamps EQSL_QSL_RCVD=Y and the received date on a QSO after
|
||||
// an eQSL Inbox download. date is an ADIF YYYYMMDD string.
|
||||
func (r *Repo) MarkEQSLConfirmed(ctx context.Context, id int64, date string) error {
|
||||
|
||||
Reference in New Issue
Block a user