diff --git a/server/webserver.py b/server/webserver.py index 738b300..8fe1ff5 100644 --- a/server/webserver.py +++ b/server/webserver.py @@ -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] diff --git a/webassets/apidocs/openapi.yml b/webassets/apidocs/openapi.yml index cf74237..104bbf2 100644 --- a/webassets/apidocs/openapi.yml +++ b/webassets/apidocs/openapi.yml @@ -65,7 +65,7 @@ paths: - APRS-IS - name: sig in: query - description: "Limit the spots to only ones from one or more Special Interest Groups. To select more than one SIG, supply a comma-separated list." + description: "Limit the spots to only ones from one or more Special Interest Groups provided as an argument. To select more than one SIG, supply a comma-separated list." required: false schema: type: string @@ -83,6 +83,13 @@ paths: - ILLW - ZLOTA - IOTA + - name: needs_sig + in: query + description: "Limit the spots to only ones from a Special Interest Grous such as POTA. Because supplying all known SIGs as a `sigs` parameter is unwieldy, and leaving `sigs` blank will also return spots with *no* SIG, this parameter can be set true to return only spots with a SIG, regardless of what it is, so long as it's not blank. This is what Field Spotter uses to exclude generic cluster spots and only retrieve xOTA things." + required: false + schema: + type: boolean + default: false - name: band in: query description: "Limit the spots to only ones from one or more bands. To select more than one band, supply a comma-separated list."