From 5364c828ebb82fdf7018360d5082a633f12118b4 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sun, 13 Aug 2023 15:31:10 -0700 Subject: [PATCH] Show all cameras on timeline in grid mode. --- src/components/surround.ts | 12 ++++-------- src/components/timeline-core.ts | 2 ++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/surround.ts b/src/components/surround.ts index ec771339..ef4a3995 100644 --- a/src/components/surround.ts +++ b/src/components/surround.ts @@ -8,7 +8,6 @@ import { } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import { CameraManager } from '../camera-manager/manager.js'; -import type { DataQuery } from '../camera-manager/types'; import basicBlockStyle from '../scss/basic-block.scss'; import { CardWideConfig, @@ -139,15 +138,12 @@ export class FrigateCardSurround extends LitElement { return null; } if (this.view?.is('live')) { - return getAllDependentCameras(this.cameraManager, this.view.camera); + return this.view.isGrid() + ? this.cameraManager?.getStore().getVisibleCameraIDs() ?? null + : getAllDependentCameras(this.cameraManager, this.view.camera); } if (this.view.isViewerView()) { - return new Set( - this.view.query - ?.getQueries() - ?.map((query: DataQuery) => [...query.cameraIDs]) - .flat(), - ); + return this.view.query?.getQueryCameraIDs() ?? null; } return null; } diff --git a/src/components/timeline-core.ts b/src/components/timeline-core.ts index 8b33f147..bcc4ef3d 100644 --- a/src/components/timeline-core.ts +++ b/src/components/timeline-core.ts @@ -496,8 +496,10 @@ export class FrigateCardTimelineCore extends LitElement { : 'media' : this.view.view; + const selectedCamera = newResults?.getSelectedResult()?.getCameraID(); this.view .evolve({ + ...(selectedCamera && { camera: selectedCamera }), view: desiredView, queryResults: newResults, }) // Whether or not to set the timeline window.