Allow floating point received_since times

This commit is contained in:
Ian Renton
2026-04-03 15:35:06 +01:00
parent 8d2fcc69b0
commit da7bb4223e
12 changed files with 25 additions and 25 deletions

View File

@@ -147,7 +147,7 @@ def alert_allowed_by_query(alert, query):
for k in query.keys():
match k:
case "received_since":
since = datetime.fromtimestamp(int(query.get(k)), pytz.UTC)
since = datetime.fromtimestamp(float(query.get(k)), pytz.UTC)
if not alert.received_time or alert.received_time <= since:
return False
case "max_duration":

View File

@@ -178,7 +178,7 @@ def spot_allowed_by_query(spot, query):
if not spot.time or spot.time <= since:
return False
case "received_since":
since = datetime.fromtimestamp(int(query.get(k)), pytz.UTC).timestamp()
since = datetime.fromtimestamp(float(query.get(k)), pytz.UTC).timestamp()
if not spot.received_time or spot.received_time <= since:
return False
case "source":

View File

@@ -67,7 +67,7 @@
<p>This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.</p>
</div>
<script src="/js/common.js?v=1775226769"></script>
<script src="/js/common.js?v=1775226906"></script>
<script>$(document).ready(function() { $("#nav-link-about").addClass("active"); }); <!-- highlight active page in nav --></script>
{% end %}

View File

@@ -69,8 +69,8 @@
</div>
<script src="/js/common.js?v=1775226769"></script>
<script src="/js/add-spot.js?v=1775226769"></script>
<script src="/js/common.js?v=1775226906"></script>
<script src="/js/add-spot.js?v=1775226906"></script>
<script>$(document).ready(function() { $("#nav-link-add-spot").addClass("active"); }); <!-- highlight active page in nav --></script>
{% end %}

View File

@@ -56,8 +56,8 @@
</div>
<script src="/js/common.js?v=1775226769"></script>
<script src="/js/alerts.js?v=1775226769"></script>
<script src="/js/common.js?v=1775226906"></script>
<script src="/js/alerts.js?v=1775226906"></script>
<script>$(document).ready(function() { $("#nav-link-alerts").addClass("active"); }); <!-- highlight active page in nav --></script>
{% end %}

View File

@@ -62,9 +62,9 @@
<script>
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
</script>
<script src="/js/common.js?v=1775226769"></script>
<script src="/js/spotsbandsandmap.js?v=1775226769"></script>
<script src="/js/bands.js?v=1775226769"></script>
<script src="/js/common.js?v=1775226906"></script>
<script src="/js/spotsbandsandmap.js?v=1775226906"></script>
<script src="/js/bands.js?v=1775226906"></script>
<script>$(document).ready(function() { $("#nav-link-bands").addClass("active"); }); <!-- highlight active page in nav --></script>
{% end %}

View File

@@ -46,10 +46,10 @@
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/tinycolor2@1.6.0/cjs/tinycolor.min.js"></script>
<script src="https://misc.ianrenton.com/jsutils/utils.js?v=1775226769"></script>
<script src="https://misc.ianrenton.com/jsutils/storage.js?v=1775226769"></script>
<script src="https://misc.ianrenton.com/jsutils/ui-ham.js?v=1775226769"></script>
<script src="https://misc.ianrenton.com/jsutils/geo.js?v=1775226769"></script>
<script src="https://misc.ianrenton.com/jsutils/utils.js?v=1775226906"></script>
<script src="https://misc.ianrenton.com/jsutils/storage.js?v=1775226906"></script>
<script src="https://misc.ianrenton.com/jsutils/ui-ham.js?v=1775226906"></script>
<script src="https://misc.ianrenton.com/jsutils/geo.js?v=1775226906"></script>
</head>
<body>

View File

@@ -189,8 +189,8 @@
</div>
</div>
<script src="/js/common.js?v=1775226769"></script>
<script src="/js/conditions.js?v=1775226769"></script>
<script src="/js/common.js?v=1775226906"></script>
<script src="/js/conditions.js?v=1775226906"></script>
<script>$(document).ready(function() { $("#nav-link-conditions").addClass("active"); }); <!-- highlight active page in nav --></script>
{% end %}

View File

@@ -70,9 +70,9 @@
<script>
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
</script>
<script src="/js/common.js?v=1775226768"></script>
<script src="/js/spotsbandsandmap.js?v=1775226768"></script>
<script src="/js/map.js?v=1775226768"></script>
<script src="/js/common.js?v=1775226906"></script>
<script src="/js/spotsbandsandmap.js?v=1775226906"></script>
<script src="/js/map.js?v=1775226906"></script>
<script>$(document).ready(function() { $("#nav-link-map").addClass("active"); }); <!-- highlight active page in nav --></script>
{% end %}

View File

@@ -87,9 +87,9 @@
<script>
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
</script>
<script src="/js/common.js?v=1775226768"></script>
<script src="/js/spotsbandsandmap.js?v=1775226768"></script>
<script src="/js/spots.js?v=1775226768"></script>
<script src="/js/common.js?v=1775226906"></script>
<script src="/js/spotsbandsandmap.js?v=1775226906"></script>
<script src="/js/spots.js?v=1775226906"></script>
<script>$(document).ready(function() { $("#nav-link-spots").addClass("active"); }); <!-- highlight active page in nav --></script>
{% end %}

View File

@@ -59,8 +59,8 @@
</div>
</div>
<script src="/js/common.js?v=1775226769"></script>
<script src="/js/status.js?v=1775226769"></script>
<script src="/js/common.js?v=1775226906"></script>
<script src="/js/status.js?v=1775226906"></script>
<script>
$(document).ready(function() { $("#nav-link-status").addClass("active"); }); <!-- highlight active page in nav -->
</script>

View File

@@ -294,7 +294,7 @@ paths:
description: Limit the alerts to only ones that the system found out about at this time or later. Time in UTC seconds since UNIX epoch. If you are using a front-end that tracks the last time it queried the API and requests alerts since then, you want *this* version of the query parameter, not "since", because otherwise it may miss things. The logic is "greater than" rather than "greater than or equal to", so you can submit the time of the last received item back to this call and you will get all the more recent alerts back, without duplicating the previous latest spot.
required: false
schema:
type: integer
type: number
- name: max_duration
in: query
description: Limit the alerts to only ones with a duration of this many seconds or less. Duration is end time minus start time, if end time is set, otherwise the activation is assumed to be short and therefore to always pass this check. This is useful to filter out people who alert POTA activations lasting months or even years, but note it will also include multi-day or multi-week DXpeditions that you might otherwise be interested in. See the dxpeditions_skip_max_duration_check parameter for the workaround.