mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 22:37:44 +00:00
Improve handling of GMA SOTA spots, SOTA references in comments, and grids in comments on VHF
This commit is contained in:
+19
-16
@@ -98,24 +98,27 @@ class GMA(HTTPSpotProvider):
|
||||
and ref_response.text != "\n"
|
||||
):
|
||||
ref_info = ref_response.json()
|
||||
# If this is POTA, SOTA or WWFF data we already have it through other means, so ignore. POTA and WWFF
|
||||
# spots come through with reftype=POTA or reftype=WWFF. SOTA is harder to figure out because both SOTA
|
||||
# and GMA summits come through with reftype=Summit, so we must check for the presence of a "sota" entry
|
||||
# to determine if it's a SOTA summit.
|
||||
if (
|
||||
spot.sig_refs
|
||||
and ref_info
|
||||
and "reftype" in ref_info
|
||||
and ref_info["reftype"] not in [ActivityName.POTA, ActivityName.WWFF]
|
||||
and (
|
||||
ref_info["reftype"] != "Summit" or "sota" not in ref_info or ref_info["sota"] == ""
|
||||
)
|
||||
):
|
||||
if spot.sig_refs and ref_info and "reftype" in ref_info:
|
||||
match ref_info["reftype"]:
|
||||
case "Summit":
|
||||
spot.sig_refs[0].sig = ActivityName.GMA
|
||||
spot.sig_refs[0].ref_type = ActivityRefType.SUMMIT
|
||||
spot.sig = ActivityName.GMA
|
||||
# Summits are a bit complicated, they can be SOTA or GMA depending on the
|
||||
# separate "sota" field:
|
||||
if "sota" in ref_info and ref_info["sota"] != "":
|
||||
spot.sig_refs[0].sig = ActivityName.SOTA
|
||||
spot.sig_refs[0].ref_type = ActivityRefType.SUMMIT
|
||||
spot.sig = ActivityName.SOTA
|
||||
else:
|
||||
spot.sig_refs[0].sig = ActivityName.GMA
|
||||
spot.sig_refs[0].ref_type = ActivityRefType.SUMMIT
|
||||
spot.sig = ActivityName.GMA
|
||||
case "POTA":
|
||||
spot.sig_refs[0].sig = ActivityName.POTA
|
||||
spot.sig_refs[0].ref_type = ActivityRefType.PARK
|
||||
spot.sig = ActivityName.POTA
|
||||
case "WWFF":
|
||||
spot.sig_refs[0].sig = ActivityName.WWFF
|
||||
spot.sig_refs[0].ref_type = ActivityRefType.PARK
|
||||
spot.sig = ActivityName.WWFF
|
||||
case "IOTA Island":
|
||||
spot.sig_refs[0].sig = ActivityName.IOTA
|
||||
spot.sig_refs[0].ref_type = ActivityRefType.ISLAND
|
||||
|
||||
Reference in New Issue
Block a user