feat(details): NEW badge on a county never worked

The cluster already answers this question for a spot; the entry panel did
not answer it for the station actually being worked. A county hunter
needs to know before the QSO ends — by the time the county shows up in
the awards table the station is long gone.

qso.CountyWorked asks about one county instead of loading the whole
worked set, narrowed to the state so it stays a few dozen rows on a
remote MySQL. It compares through award.USCountyKey on both sides rather
than in SQL, because logged spellings vary ("Los Angeles" against
"LOS ANGELES, CA") and that key function is what resolves it everywhere
else.

An empty or non-US county is not "new" but unknown, and shows nothing: a
badge on a guess is worse than no badge.
This commit is contained in:
2026-08-01 01:46:32 +02:00
parent 599621a998
commit 6255a9f218
7 changed files with 96 additions and 10 deletions
+18
View File
@@ -15528,6 +15528,24 @@ func (a *App) ClusterSpotStatuses(spots []SpotQuery) []SpotStatus {
return out
}
// IsNewUSCounty reports whether this state/county pair has never been worked.
//
// Same question the cluster's NEW CTY badge answers, asked for the contact
// currently in the entry panel: county hunters want to know BEFORE the QSO ends,
// and by the time a county shows up in the awards table the station is long
// gone. Empty (or non-US) input is not "new" — it is unknown, and a badge on a
// guess is worse than no badge.
func (a *App) IsNewUSCounty(state, cnty string) bool {
if a.qso == nil || strings.TrimSpace(cnty) == "" {
return false
}
worked, err := a.qso.CountyWorked(a.ctx, state, cnty, award.USCountyKey)
if err != nil {
return false
}
return !worked
}
// ── CAT sharing (Hamlib NET rigctl server) ────────────────────────────────
// catShareRig adapts the CAT manager to what the rigctld server needs. A thin