Implement has_sig spot filter. Closes #49

This commit is contained in:
Ian Renton
2025-10-19 14:36:22 +01:00
parent 38222b98c8
commit e11483e230
2 changed files with 14 additions and 1 deletions

View File

@@ -165,8 +165,14 @@ class WebServer:
sources = query.get(k).split(",")
spots = [s for s in spots if s.source and s.source in sources]
case "sig":
# If a list of sigs is provided, the spot must have a sig and it must match one of them
sigs = query.get(k).split(",")
spots = [s for s in spots if s.sig and s.sig in sigs]
case "needs_sig":
# If true, a sig is required, regardless of what it is, it just can't be missing.
needs_sig = query.get(k).upper() == "TRUE"
if needs_sig:
spots = [s for s in spots if s.sig]
case "band":
bands = query.get(k).split(",")
spots = [s for s in spots if s.band and s.band in bands]