mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Fix multi callsign alerts from NG3K #38
This commit is contained in:
@@ -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)]
|
||||
if not dx_calls:
|
||||
dx_calls = [parts[2].upper()]
|
||||
|
||||
dx_country = parts[1]
|
||||
qsl_info = parts[3]
|
||||
|
||||
@@ -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 => `<a class='dx-link' href='https://qrz.com/db/${call}' target='_new'>${call}</a>`).join(", ");
|
||||
}
|
||||
|
||||
// Format freqs & modes
|
||||
var freqsModesText = "";
|
||||
if (a["freqs_modes"] != null) {
|
||||
@@ -171,8 +177,7 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
// Populate the row
|
||||
$tr.append(`<td class='nowrap'>${start_time_formatted}</td>`);
|
||||
$tr.append(`<td class='nowrap'>${end_time_formatted}</td>`);
|
||||
// TODO take a["dx_calls"] and add a callsign to the following td for every one in the list.
|
||||
$tr.append(`<td class='nowrap'><span class='flag-wrapper hideonmobile' title='${dx_country}'>${dx_flag}</span><a class='dx-link' href='https://qrz.com/db/${call}' target='_new'>${call}</a></td>`);
|
||||
$tr.append(`<td class='nowrap'><span class='flag-wrapper hideonmobile' title='${dx_country}'>${dx_flag}</span>${dx_calls_html}</td>`);
|
||||
$tr.append(`<td class='hideonmobile'>${freqsModesText}</td>`);
|
||||
$tr.append(`<td class='hideonmobile'>${commentText}</td>`);
|
||||
$tr.append(`<td class='nowrap hideonmobile'><span class='icon-wrapper'><i class='fa-solid fa-${a["icon"]}'></i></span> ${sigSourceText}</td>`);
|
||||
|
||||
Reference in New Issue
Block a user