diff --git a/core/sig_utils.py b/core/sig_utils.py index 3d7ae43..b788bb3 100644 --- a/core/sig_utils.py +++ b/core/sig_utils.py @@ -98,7 +98,12 @@ def get_sig_ref_info(sig, sig_ref_id): for feature in data["features"]: if feature["properties"]["wotaId"] == sig_ref_id: sig_ref.name = feature["properties"]["title"] + # Fudge WOTA URLs. Outlying fell (LDO) URLs don't match their ID numbers but require 214 to be + # added to them sig_ref.url = "https://www.wota.org.uk/MM_" + sig_ref_id + if sig_ref_id.upper().startswith("LDO-"): + number = int(sig_ref_id.upper().replace("LDO-", "")) + sig_ref.url = "https://www.wota.org.uk/MM_LDO-" + str(number + 214) sig_ref.grid = feature["properties"]["qthLocator"] sig_ref.latitude = feature["geometry"]["coordinates"][1] sig_ref.longitude = feature["geometry"]["coordinates"][0] diff --git a/spothole.py b/spothole.py index 6386a59..81388a9 100644 --- a/spothole.py +++ b/spothole.py @@ -10,6 +10,7 @@ from core.cleanup import CleanupTimer from core.config import config, WEB_SERVER_PORT, SERVER_OWNER_CALLSIGN from core.constants import SOFTWARE_NAME, SOFTWARE_VERSION from core.lookup_helper import lookup_helper +from core.sig_utils import get_sig_ref_info from core.status_reporter import StatusReporter from server.webserver import WebServer