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(