mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 16:59:25 +00:00
Implement has_sig spot filter. Closes #49
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user