mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-12-15 16:43:38 +00:00
Add dx_call_includes filter
This commit is contained in:
@@ -246,6 +246,9 @@ class WebServer:
|
|||||||
case "comment_includes":
|
case "comment_includes":
|
||||||
comment_includes = query.get(k).strip()
|
comment_includes = query.get(k).strip()
|
||||||
spots = [s for s in spots if s.comment and comment_includes.upper() in s.comment.upper()]
|
spots = [s for s in spots if s.comment and comment_includes.upper() in s.comment.upper()]
|
||||||
|
case "dx_call_includes":
|
||||||
|
dx_call_includes = query.get(k).strip()
|
||||||
|
spots = [s for s in spots if s.dx_call and dx_call_includes.upper() in s.dx_call.upper()]
|
||||||
case "allow_qrt":
|
case "allow_qrt":
|
||||||
# If false, spots that are flagged as QRT are not returned.
|
# If false, spots that are flagged as QRT are not returned.
|
||||||
prevent_qrt = query.get(k).upper() == "FALSE"
|
prevent_qrt = query.get(k).upper() == "FALSE"
|
||||||
@@ -320,6 +323,9 @@ class WebServer:
|
|||||||
case "dx_continent":
|
case "dx_continent":
|
||||||
dxconts = query.get(k).split(",")
|
dxconts = query.get(k).split(",")
|
||||||
alerts = [a for a in alerts if a.dx_continent and a.dx_continent in dxconts]
|
alerts = [a for a in alerts if a.dx_continent and a.dx_continent in dxconts]
|
||||||
|
case "dx_call_includes":
|
||||||
|
dx_call_includes = query.get(k).strip()
|
||||||
|
spots = [a for a in alerts if a.dx_call and dx_call_includes.upper() in a.dx_call.upper()]
|
||||||
# If we have a "limit" parameter, we apply that last, regardless of where it appeared in the list of keys.
|
# If we have a "limit" parameter, we apply that last, regardless of where it appeared in the list of keys.
|
||||||
if "limit" in query.keys():
|
if "limit" in query.keys():
|
||||||
alerts = alerts[:int(query.get("limit"))]
|
alerts = alerts[:int(query.get("limit"))]
|
||||||
|
|||||||
@@ -207,6 +207,12 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
- name: dx_call_includes
|
||||||
|
in: query
|
||||||
|
description: "Limit the alerts to only ones where the DX callsign includes the supplied string (case-insensitive). Generally a complete callsign, but you can supply a shorter string for partial matches."
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
- name: comment_includes
|
- name: comment_includes
|
||||||
in: query
|
in: query
|
||||||
description: "Return only spots where the comment includes the provided string (case-insensitive)."
|
description: "Return only spots where the comment includes the provided string (case-insensitive)."
|
||||||
@@ -317,7 +323,7 @@ paths:
|
|||||||
- WAI
|
- WAI
|
||||||
- name: dx_continent
|
- name: dx_continent
|
||||||
in: query
|
in: query
|
||||||
description: "Limit the alerts to only ones where the DX (the operator being spotted) is on the given continent(s). To select more than one continent, supply a comma-separated list."
|
description: "Limit the alerts to only ones where the DX operator is on the given continent(s). To select more than one continent, supply a comma-separated list."
|
||||||
required: false
|
required: false
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
@@ -329,6 +335,12 @@ paths:
|
|||||||
- AF
|
- AF
|
||||||
- OC
|
- OC
|
||||||
- AN
|
- AN
|
||||||
|
- name: dx_call_includes
|
||||||
|
in: query
|
||||||
|
description: "Limit the alerts to only ones where the DX callsign includes the supplied string (case-insensitive). Generally a complete callsign, but you can supply a shorter string for partial matches."
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Success
|
description: Success
|
||||||
|
|||||||
Reference in New Issue
Block a user