Allow spots and alerts to have multiple activities #143

This commit is contained in:
Ian Renton
2026-09-24 22:57:46 +01:00
parent 81166dccab
commit 4477942bec
34 changed files with 217 additions and 157 deletions
+11 -11
View File
@@ -106,49 +106,49 @@ class GMA(HTTPSpotProvider):
if "sota" in ref_info and ref_info["sota"] != "":
spot.activity_refs[0].activity = ActivityName.SOTA
spot.activity_refs[0].ref_type = ActivityRefType.SUMMIT
spot.activity = ActivityName.SOTA
spot.add_activity(ActivityName.SOTA)
else:
spot.activity_refs[0].activity = ActivityName.GMA
spot.activity_refs[0].ref_type = ActivityRefType.SUMMIT
spot.activity = ActivityName.GMA
spot.add_activity(ActivityName.GMA)
case "POTA":
spot.activity_refs[0].activity = ActivityName.POTA
spot.activity_refs[0].ref_type = ActivityRefType.PARK
spot.activity = ActivityName.POTA
spot.add_activity(ActivityName.POTA)
case "WWFF":
spot.activity_refs[0].activity = ActivityName.WWFF
spot.activity_refs[0].ref_type = ActivityRefType.PARK
spot.activity = ActivityName.WWFF
spot.add_activity(ActivityName.WWFF)
case "IOTA Island":
spot.activity_refs[0].activity = ActivityName.IOTA
spot.activity_refs[0].ref_type = ActivityRefType.ISLAND
spot.activity = ActivityName.IOTA
spot.add_activity(ActivityName.IOTA)
case "GMA Island":
spot.activity_refs[0].activity = ActivityName.GMA_ISLANDS
spot.activity_refs[0].ref_type = ActivityRefType.ISLAND
spot.activity = ActivityName.GMA_ISLANDS
spot.add_activity(ActivityName.GMA_ISLANDS)
case "Lighthouse (ILLW)":
spot.activity_refs[0].activity = ActivityName.ILLW
spot.activity_refs[0].ref_type = ActivityRefType.LIGHTHOUSE
spot.activity = ActivityName.ILLW
spot.add_activity(ActivityName.ILLW)
case "Lighthouse (ARLHS)":
spot.activity_refs[0].activity = ActivityName.ARLHS
spot.activity_refs[0].ref_type = ActivityRefType.LIGHTHOUSE
spot.activity = ActivityName.ARLHS
spot.add_activity(ActivityName.ARLHS)
case "Castle":
spot.activity_refs[0].activity = ActivityName.WCA
spot.activity_refs[0].ref_type = ActivityRefType.CASTLE
spot.activity = ActivityName.WCA
spot.add_activity(ActivityName.WCA)
case "Mill":
spot.activity_refs[0].activity = ActivityName.MOTA
spot.activity_refs[0].ref_type = ActivityRefType.MILL
spot.activity = ActivityName.MOTA
spot.add_activity(ActivityName.MOTA)
case _:
logger.warning(
f"GMA spot found with ref type {ref_info['reftype']}, developer needs to add support for this!"
)
spot.activity_refs[0].activity = ref_info["reftype"]
spot.activity = ref_info["reftype"]
spot.add_activity(ref_info["reftype"])
elif not ref_response.from_cache:
if not ref_response.ok: