Quick fixes (#17278)

* Fix check

* Fix default loading state
This commit is contained in:
Nicolas Mowen 2025-03-20 14:09:57 -06:00 committed by GitHub
parent e396043f79
commit 060659044e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -85,7 +85,9 @@ def go2rtc_camera_stream(request: Request, camera_name: str):
f"http://127.0.0.1:1984/api/streams?src={camera_name}&video=all&audio=all&microphone"
)
if not r.ok:
if request.app.frigate_config.cameras.get(camera_name, {}).get("enabled", True):
camera_config = request.app.frigate_config.cameras.get(camera_name)
if camera_config and camera_config.enabled:
logger.error("Failed to fetch streams from go2rtc")
return JSONResponse(

View File

@ -147,7 +147,7 @@ export function useCameraActivity(
return cameras[camera.name].camera_fps == 0 && stats["service"].uptime > 60;
}, [camera, stats]);
const isCameraEnabled = cameraEnabled ? cameraEnabled === "ON" : undefined;
const isCameraEnabled = cameraEnabled ? cameraEnabled === "ON" : true;
return {
enabled: isCameraEnabled,