Improve SIG Ref lookup

This commit is contained in:
Ian Renton
2025-12-15 12:13:41 +00:00
parent 27db248398
commit 097c75eadd
5 changed files with 46 additions and 47 deletions

View File

@@ -7,7 +7,7 @@ from datetime import datetime, timedelta
import pytz
from core.lookup_helper import lookup_helper
from core.sig_utils import get_icon_for_sig, get_sig_ref_info
from core.sig_utils import get_icon_for_sig, populate_sig_ref_info
# Data class that defines an alert.
@@ -102,10 +102,7 @@ class Alert:
# from WAB and WAI, which count as a SIG even though there's no real lookup, just maths
if self.sig_refs and len(self.sig_refs) > 0:
for sig_ref in self.sig_refs:
lookup_data = get_sig_ref_info(sig_ref.sig, sig_ref.id)
if lookup_data:
# Update the sig_ref data from the lookup
sig_ref.__dict__.update(lookup_data.__dict__)
populate_sig_ref_info(sig_ref)
# If the spot itself doesn't have a SIG yet, but we have at least one SIG reference, take that reference's SIG
# and apply it to the whole spot.