Toggle to allow DXpeditions to be displayed even if they exceed max_duration. Closes #17

This commit is contained in:
Ian Renton
2025-10-09 17:29:21 +01:00
parent b27d0f826c
commit 791a3a0dc4
9 changed files with 36 additions and 14 deletions

View File

@@ -206,9 +206,12 @@ class WebServer:
case "max_duration":
max_duration = int(query.get(k))
# Check the duration if end_time is provided. If end_time is not provided, assume the activation is
# "short", i.e. it always passes this check.
# "short", i.e. it always passes this check. If dxpeditions_skip_max_duration_check is true and
# the alert is a dxpedition, it also always passes the check.
dxpeditions_skip_check = bool(query.get(
"dxpeditions_skip_max_duration_check")) if "dxpeditions_skip_max_duration_check" in query.keys() else False
alerts = [a for a in alerts if (a.end_time and a.end_time - a.start_time <= max_duration) or
not a.end_time]
not a.end_time or (dxpeditions_skip_check and a.is_dxpedition)]
case "source":
sources = query.get(k).split(",")
alerts = [a for a in alerts if a.source and a.source in sources]