diff --git a/internal/qso/stats.go b/internal/qso/stats.go index 21aed0c..9c230bb 100644 --- a/internal/qso/stats.go +++ b/internal/qso/stats.go @@ -392,8 +392,13 @@ func (r *Repo) Stats(ctx context.Context, from, to time.Time, contestID string, if st := strings.ToUpper(strings.TrimSpace(station.String)); st != "" { stationC[st]++ } + // Bucket a blank/unknown continent under "Unknown" rather than dropping it, + // so the continent breakdown totals the same as the QSO count (a handful of + // QSOs with no resolved continent made the donut read a few short). if c := strings.ToUpper(strings.TrimSpace(cont.String)); c != "" { contC[c]++ + } else { + contC["Unknown"]++ } if c := strings.TrimSpace(country.String); c != "" { entityC[c]++ @@ -436,6 +441,9 @@ func (r *Repo) Stats(ctx context.Context, from, to time.Time, contestID string, s.UniqueCalls = len(calls) s.Entities = len(entities) s.Continents = len(contC) + if _, ok := contC["Unknown"]; ok { + s.Continents-- // "Unknown" is a catch-all bucket, not a real continent + } if !first.IsZero() { s.FirstQSO = first.UTC().Format(time.RFC3339) s.LastQSO = last.UTC().Format(time.RFC3339)