mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-15 18:13:01 +03:00
Miscellaneous fixes (#24970)
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
* analytics notifications flag and device grant warnings - report notifications as on when any camera enables them, not only the global setting - don't warn about device nodes the runtime users can already use, such as world-rw nodes in an unprivileged LXC * clarify which stream the All Cameras dashboard uses * add exception catchall for autotracking calibration * only default review api after to 24 hours when no bounds are given The review endpoint replaced a missing or zero `after` with 24 hours ago, so a `before`-only query older than 24 hours returned nothing and `after=0` couldn't mean no lower bound. The default now applies only when neither `before` nor `after` is sent, a `before`-only query has no lower bound, and both bounds use `is not None` checks. The Live dashboard alerts bar sends no bounds and keeps the 24 hour window.
This commit is contained in:
@@ -89,6 +89,37 @@ class TestHttpReview(BaseTestHttp):
|
||||
assert response_json[0]["id"] == id
|
||||
assert response_json[0]["has_been_reviewed"] == False
|
||||
|
||||
def test_get_review_before_only_has_no_lower_bound(self):
|
||||
now = datetime.now().timestamp()
|
||||
|
||||
with AuthTestClient(self.app) as client:
|
||||
id = "123456.random"
|
||||
super().insert_mock_review_segment(id, now - 72 * 3600, now - 71 * 3600)
|
||||
response = client.get("/review", params={"before": now - 48 * 3600})
|
||||
assert response.status_code == 200
|
||||
assert [r["id"] for r in response.json()] == [id]
|
||||
|
||||
def test_get_review_after_zero_is_not_defaulted(self):
|
||||
now = datetime.now().timestamp()
|
||||
|
||||
with AuthTestClient(self.app) as client:
|
||||
id = "123456.random"
|
||||
super().insert_mock_review_segment(id, now - 72 * 3600, now - 71 * 3600)
|
||||
response = client.get("/review", params={"after": 0})
|
||||
assert response.status_code == 200
|
||||
assert [r["id"] for r in response.json()] == [id]
|
||||
|
||||
def test_get_review_no_bounds_defaults_to_last_24_hours(self):
|
||||
now = datetime.now().timestamp()
|
||||
|
||||
with AuthTestClient(self.app) as client:
|
||||
super().insert_mock_review_segment(
|
||||
"123456.random", now - 72 * 3600, now - 71 * 3600
|
||||
)
|
||||
response = client.get("/review", params={"limit": 10})
|
||||
assert response.status_code == 200
|
||||
assert response.json() == []
|
||||
|
||||
def test_get_review_with_time_filter_no_matches(self):
|
||||
"""Test that review items outside the range are not returned."""
|
||||
now = datetime.now().timestamp()
|
||||
|
||||
Reference in New Issue
Block a user