fix: added additional selection in recent qso filters

This commit is contained in:
2026-06-18 19:08:38 +02:00
parent dd2deee939
commit 679e8f8d39
9 changed files with 381 additions and 6 deletions
+64
View File
@@ -3263,6 +3263,70 @@ func (a *App) BulkUpdateQSL(ids []int64, u QSLBulkUpdate) (int, error) {
return n, nil
}
// bulkFieldColumns maps the UI field ids to their QSO column. Kept in the app
// layer so the frontend works with stable ids, not raw column names.
var bulkFieldColumns = map[string]string{
// QSL / upload status
"lotw_sent": "lotw_sent",
"lotw_rcvd": "lotw_rcvd",
"eqsl_sent": "eqsl_sent",
"eqsl_rcvd": "eqsl_rcvd",
"qsl_sent": "qsl_sent",
"qsl_rcvd": "qsl_rcvd",
"qsl_via": "qsl_via",
"qrz_upload": "qrzcom_qso_upload_status",
"clublog_upload": "clublog_qso_upload_status",
"hrdlog_upload": "hrdlog_qso_upload_status",
// My station / operator
"station_callsign": "station_callsign",
"operator": "operator",
"my_grid": "my_grid",
"my_country": "my_country",
"my_state": "my_state",
"my_cnty": "my_cnty",
"my_iota": "my_iota",
"my_sota_ref": "my_sota_ref",
"my_pota_ref": "my_pota_ref",
"my_wwff_ref": "my_wwff_ref",
"my_street": "my_street",
"my_city": "my_city",
"my_postal_code": "my_postal_code",
"my_rig": "my_rig",
"my_antenna": "my_antenna",
"my_sig": "my_sig",
"my_sig_info": "my_sig_info",
// Misc text
"comment": "comment",
"notes": "notes",
"rig": "rig",
"ant": "ant",
}
// BulkUpdateField sets one QSL/upload status field to value on the given QSOs
// (e.g. flip a filtered set from N to R so they upload). field is one of the
// ids in bulkFieldColumns; value is a status code (Y/N/R/I) or "" to clear.
// Returns how many rows were updated.
func (a *App) BulkUpdateField(ids []int64, field, value string) (int64, error) {
if a.qso == nil {
return 0, fmt.Errorf("db not initialized")
}
col, ok := bulkFieldColumns[field]
if !ok {
return 0, fmt.Errorf("unknown field %q", field)
}
// Trim only — do NOT force case here: status codes arrive already upper from
// the UI, while free-text fields (address, antenna, comment…) must keep
// their case. Callsign/grid uppercasing is handled in the UI.
n, err := a.qso.BulkSetField(a.ctx, ids, col, strings.TrimSpace(value))
if err != nil {
return 0, err
}
if n > 0 {
a.invalidateAwardStats()
}
return n, nil
}
// WorkedBefore returns prior contacts with the given callsign at both
// call and DXCC granularity. Pass dxccHint=0 when unknown — the function
// will infer it from past QSOs with the same call when possible.