From c2c3981cdae79c0d79742edb7291a7565ecc06cf Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Fri, 18 Sep 2026 18:45:06 +0100 Subject: [PATCH] If a spot has no other activity but its DX call does match a call from an ongoing DXpedition, assign that activity to it. Closes #147 --- data/spot.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/data/spot.py b/data/spot.py index 855c689..ab33d2b 100644 --- a/data/spot.py +++ b/data/spot.py @@ -393,6 +393,22 @@ class Spot: elif self.dx_call.upper().endswith(ActivityName.MARITIME_MOBILE): self.sig = ActivityName.MARITIME_MOBILE + # Alright, now let's get really fancy. Check if the DX callsign matches one taking part in a currently + # running DXpedition which we know from the alerts list. + if self.dx_call and not self.sig: + now = datetime.now(pytz.UTC).timestamp() + for alert in DATA_STORE.alerts.values(): + if ( + alert.sig == ActivityName.DXPEDITION + and alert.dx_calls + and alert.start_time + and alert.end_time + and alert.start_time < now < alert.end_time + and self.dx_call.upper() in [c.upper() for c in alert.dx_calls if c] + ): + self.sig = ActivityName.DXPEDITION + break + # Parse "de_grid -> dx_grid" structures from the comment if self.comment: grid_mode_grid_match = re.search(