diff --git a/core/constants.py b/core/constants.py index 3ae503a..487f3b5 100644 --- a/core/constants.py +++ b/core/constants.py @@ -53,6 +53,12 @@ SIGS = [ description="Islands on the Air", ref_regex=r"[A-Z]{2}\-\d{3}", ), + SIG( + name="GMA Island", + comment_names=[], + description="Global Mountain Activity - Islands", + ref_regex=r"(([A-Z]{2}\-\d{3})|([A-Z0-9]{1,3}\/[A-Z]{2}\-\d{3}))", + ), SIG( name="MOTA", comment_names=["MOTA"], diff --git a/core/sig_lookup_helper.py b/core/sig_lookup_helper.py index e6b11cf..32a4b0e 100644 --- a/core/sig_lookup_helper.py +++ b/core/sig_lookup_helper.py @@ -73,6 +73,20 @@ def get_sig_ref_info(sig, ref_id): sig_ref.url = f"https://www.beachesontheair.com/beaches/{sig_ref.name.lower().replace(' ', '-')}" return sig_ref + elif sig.upper() == "GMA Islands": + # GMA Islands is a bit of a mess of GMA and IOTA references. Try looking them both up and see what returns + # the best result. + iota_lookup = get_sig_ref_info("IOTA", ref_id) + gma_lookup = get_sig_ref_info("GMA", ref_id) + for key, value in iota_lookup.__dict__.items(): + if value is not None and sig_ref.__dict__.get(key) is None: + sig_ref.__dict__[key] = value + for key, value in gma_lookup.__dict__.items(): + if value is not None and sig_ref.__dict__.get(key) is None: + sig_ref.__dict__[key] = value + sig_ref.ref_type = "Island" + return sig_ref + ### ACTUAL LOOKUP ### # # OK, this is something we have to look up. Now check to see if our data store contains reference data and use diff --git a/providers/spot/gma.py b/providers/spot/gma.py index 33c7036..e36a334 100644 --- a/providers/spot/gma.py +++ b/providers/spot/gma.py @@ -117,6 +117,9 @@ class GMA(HTTPSpotProvider): case "IOTA Island": spot.sig_refs[0].sig = "IOTA" spot.sig = "IOTA" + case "GMA Island": + spot.sig_refs[0].sig = "GMA Island" + spot.sig = "GMA Island" case "Lighthouse (ILLW)": spot.sig_refs[0].sig = "ILLW" spot.sig = "ILLW" diff --git a/templates/add_spot.html b/templates/add_spot.html index 400fdf9..3781ac6 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index 9a760f2..1e8515d 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -84,7 +84,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 3545280..e25eb27 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,8 +76,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 7207d2b..9e16f2c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -15,10 +15,10 @@ window.fetchEventSource = fetchEventSource; - - - - + + + + {% end %} {% block body %}