mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-01 04:16:50 +03:00
fix the has_clip self-heal for events with no recordings
`vod_event` looked for a `(body, 404)` tuple, but `vod_ts` returns a `JSONResponse`, so the check never matched and an old event whose recordings are gone kept offering a clip that can't play. It now checks the response status code.
This commit is contained in:
@@ -886,9 +886,8 @@ async def vod_event(
|
|||||||
# If the recordings are not found and the event started more than 5 minutes ago, set has_clip to false
|
# If the recordings are not found and the event started more than 5 minutes ago, set has_clip to false
|
||||||
if (
|
if (
|
||||||
event.start_time < datetime.now().timestamp() - 300
|
event.start_time < datetime.now().timestamp() - 300
|
||||||
and type(vod_response) is tuple
|
and isinstance(vod_response, JSONResponse)
|
||||||
and len(vod_response) == 2
|
and vod_response.status_code == 404
|
||||||
and vod_response[1] == 404
|
|
||||||
):
|
):
|
||||||
Event.update(has_clip=False).where(Event.id == event_id).execute()
|
Event.update(has_clip=False).where(Event.id == event_id).execute()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user