Backwards compatibility for critical v1 APIs. Closes #119

This commit is contained in:
Ian Renton
2026-08-08 14:15:29 +01:00
parent 43763bf76f
commit 4be4e4550a
5 changed files with 177 additions and 6 deletions
+8 -2
View File
@@ -39,6 +39,13 @@ class GMA(HTTPSpotProvider):
lat = float(source_spot["LAT"]) if (source_spot["LAT"] and source_spot["LAT"] != "") else None
lon = float(source_spot["LON"]) if (source_spot["LON"] and source_spot["LON"] != "") else None
# Seen some real janky times from GMA, if we don't understand it just ignore this spot
try:
time = datetime.strptime(source_spot["DATE"] + source_spot["TIME"], "%Y%m%d%H%M").replace(
tzinfo=pytz.UTC).timestamp()
except ValueError:
continue
spot = Spot(source=self.name,
dx_call=source_spot["ACTIVATOR"].upper(),
de_call=source_spot["SPOTTER"].upper(),
@@ -50,8 +57,7 @@ class GMA(HTTPSpotProvider):
comment=source_spot["TEXT"],
sig_refs=[SIGRef(id=source_spot["REF"], sig="", name=source_spot["NAME"], latitude=lat,
longitude=lon)],
time=datetime.strptime(source_spot["DATE"] + source_spot["TIME"], "%Y%m%d%H%M").replace(
tzinfo=pytz.UTC).timestamp(),
time=time,
dx_latitude=lat,
dx_longitude=lon,
qrt=source_spot["QRG"] == "QRT")