mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-11 14:31:14 +03:00
Fix when model tries to request an invalid camera
This commit is contained in:
parent
99aa8ab522
commit
115e7525c6
@ -547,9 +547,21 @@ async def _execute_get_live_context(
|
|||||||
camera: str,
|
camera: str,
|
||||||
allowed_cameras: List[str],
|
allowed_cameras: List[str],
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
|
# Reject wildcards explicitly so models retry with a real camera name
|
||||||
|
# instead of silently fanning out across every camera.
|
||||||
|
if camera in ("*", "all"):
|
||||||
|
return {
|
||||||
|
"error": (
|
||||||
|
"get_live_context requires a single camera name; wildcards "
|
||||||
|
"are not supported. Call this tool once per camera."
|
||||||
|
),
|
||||||
|
"available_cameras": allowed_cameras,
|
||||||
|
}
|
||||||
|
|
||||||
if camera not in allowed_cameras:
|
if camera not in allowed_cameras:
|
||||||
return {
|
return {
|
||||||
"error": f"Camera '{camera}' not found or access denied",
|
"error": f"Camera '{camera}' not found or access denied",
|
||||||
|
"available_cameras": allowed_cameras,
|
||||||
}
|
}
|
||||||
|
|
||||||
if camera not in request.app.frigate_config.cameras:
|
if camera not in request.app.frigate_config.cameras:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user