diff --git a/alertproviders/ng3k.py b/alertproviders/ng3k.py index 3210989..5d8c830 100644 --- a/alertproviders/ng3k.py +++ b/alertproviders/ng3k.py @@ -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] diff --git a/webassets/js/alerts.js b/webassets/js/alerts.js index 3d4525b..b438ef1 100644 --- a/webassets/js/alerts.js +++ b/webassets/js/alerts.js @@ -144,6 +144,12 @@ function addAlertRowsToTable(tbody, alerts) { dx_country = "Unknown or not a country" } + // Format dx calls + var dx_calls_html = ""; + if (a["dx_calls"] != null) { + dx_calls_html = a["dx_calls"].map(call => `${call}`).join(", "); + } + // Format freqs & modes var freqsModesText = ""; if (a["freqs_modes"] != null) { @@ -171,8 +177,7 @@ function addAlertRowsToTable(tbody, alerts) { // Populate the row $tr.append(`