Fix multi callsign alerts from NG3K #38

This commit is contained in:
Ian Renton
2025-10-11 20:21:52 +01:00
parent cc816d8662
commit 3ed9b95b9b
2 changed files with 12 additions and 8 deletions

View File

@@ -53,14 +53,13 @@ class NG3K(HTTPAlertProvider):
# Sometimes the DX callsign is "real", sometimes you just get a prefix with the real working callsigns being
# provided in the "by" field. e.g. call="JW", by="By LA7XK as JW7XK, LA6VM as JW6VM, LA9DL as JW9DL". So
# if there are "as" callsigns in the "by" field, we extract them and replace the main call with them.
# TODO this doesn't work yet, debug
# if there are "as" callsigns in the "by" field, we extract them and use them, otherwise we fall back to the
# "real" call field.
extra_parts = parts[5].split("; ")
by = extra_parts[0]
dx_calls = [parts[2].upper()]
match = self.AS_CALL_PATTERN.match(by)
if match:
dx_calls = [x.group(1) for x in re.finditer(self.AS_CALL_PATTERN, by)]
dx_calls = [x.group(1) for x in re.finditer(self.AS_CALL_PATTERN, by)]
if not dx_calls:
dx_calls = [parts[2].upper()]
dx_country = parts[1]
qsl_info = parts[3]