perf(lotw): stop asking for the QSL details by default

A tester compared LogHX's two download options on the same account: two minutes
for the confirmations, twenty for the confirmations with QSO details. OpsLog was
always sending qso_qsldetail=yes — LogHX's slow option — which is the whole of
the wait people were reporting.

Marking a confirmation needs call, date, band and mode; the detail adds the QSL
date and the station's grid, state and county. Now a choice, off by default, and
forced on when the download is also ADDING the QSOs it cannot find — the one
case where those fields have no other source.
This commit is contained in:
2026-08-28 08:54:42 +02:00
parent b24f880d62
commit 65cae0d822
7 changed files with 75 additions and 7 deletions
+15 -4
View File
@@ -89,7 +89,7 @@ func readWithProgress(ctx context.Context, r io.Reader, note func(string)) ([]by
// non-empty, only confirmations for that station callsign are returned (an
// LoTW account holds every call you operate — F4BPO, F4BPO/P, TM2Q — so this
// scopes the pull to the active profile's call).
func DownloadLoTWConfirmations(ctx context.Context, client *http.Client, cfg ServiceConfig, since, ownCall string, note func(string)) (string, error) {
func DownloadLoTWConfirmations(ctx context.Context, client *http.Client, cfg ServiceConfig, since, ownCall string, detail bool, note func(string)) (string, error) {
user := strings.TrimSpace(cfg.Username)
if user == "" || cfg.Password == "" {
return "", fmt.Errorf("lotw: website login (username/password) not set")
@@ -98,8 +98,19 @@ func DownloadLoTWConfirmations(ctx context.Context, client *http.Client, cfg Ser
q.Set("login", user)
q.Set("password", cfg.Password)
q.Set("qso_query", "1")
q.Set("qso_qsl", "yes") // only QSLed (confirmed) records
q.Set("qso_qsldetail", "yes") // include QSL_RCVD / QSLRDATE detail
q.Set("qso_qsl", "yes") // only QSLed (confirmed) records
// qso_qsldetail is what LoTW charges for: it adds the QSL date and the
// station's own DXCC / grid / state / county to every record, and takes an
// order of magnitude longer to build — a report that arrives in two minutes
// without it takes twenty with it, measured on the same account.
//
// What we actually need to mark a confirmation is call, date, band and mode.
// The rest is worth its price only when the download is also ADDING the QSOs
// it cannot find, which is the one case where the extra fields are the only
// source for them.
if detail {
q.Set("qso_qsldetail", "yes")
}
if c := strings.TrimSpace(ownCall); c != "" {
q.Set("qso_owncall", c) // restrict to this station callsign
}
@@ -507,7 +518,7 @@ func TestLoTW(cfg ServiceConfig, stationDataPath string) (string, error) {
}
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
if _, err := DownloadLoTWConfirmations(ctx, nil, cfg, "2099-01-01", "", nil); err != nil {
if _, err := DownloadLoTWConfirmations(ctx, nil, cfg, "2099-01-01", "", false, nil); err != nil {
return "", fmt.Errorf("%s — but the DOWNLOAD login failed: %w", up, err)
}
return up + ". Download login accepted.", nil