Continue work on bands display. #48

This commit is contained in:
Ian Renton
2025-10-20 21:01:00 +01:00
parent 6ca9f28a56
commit 0db674eeb2
5 changed files with 159 additions and 29 deletions

View File

@@ -207,6 +207,11 @@ class WebServer:
needs_sig = query.get(k).upper() == "TRUE"
if needs_sig:
spots = [s for s in spots if s.sig]
case "needs_sig_ref":
# If true, at least one sig ref is required, regardless of what it is, it just can't be missing.
needs_sig_ref = query.get(k).upper() == "TRUE"
if needs_sig_ref:
spots = [s for s in spots if s.sig_refs and len(s.sig_refs) > 0]
case "band":
bands = query.get(k).split(",")
spots = [s for s in spots if s.band and s.band in bands]
@@ -230,11 +235,11 @@ class WebServer:
prevent_qrt = query.get(k).upper() == "FALSE"
if prevent_qrt:
spots = [s for s in spots if not s.qrt or s.qrt == False]
case "needs_location":
# If true, spots require a location to be returned
needs_location = query.get(k).upper() == "TRUE"
if needs_location:
spots = [s for s in spots if s.latitude and s.longitude]
case "needs_good_location":
# If true, spots require a "good" location to be returned
needs_good_location = query.get(k).upper() == "TRUE"
if needs_good_location:
spots = [s for s in spots if s.dx_location_good]
case "dedupe":
# Ensure only the latest spot of each callsign is present in the list. This relies on the list being
# in reverse time order, so if any future change allows re-ordering the list, that should be done