From fc5785150c3351a30f8277ad2dafa911e81146aa Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Tue, 28 Mar 2023 20:06:44 -0700 Subject: [PATCH] Fix broken show_recordings timeline option . --- src/components/timeline-core.ts | 1 + src/utils/timeline-source.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/timeline-core.ts b/src/components/timeline-core.ts index 59bcb9ce..4bc8a063 100644 --- a/src/components/timeline-core.ts +++ b/src/components/timeline-core.ts @@ -1073,6 +1073,7 @@ export class FrigateCardTimelineCore extends LitElement { this.cameraManager, cameraIDs, this.timelineConfig.media, + this.timelineConfig.show_recordings, ); } else { this._timelineSource = null; diff --git a/src/utils/timeline-source.ts b/src/utils/timeline-source.ts index 67d2a2a8..343ad79e 100644 --- a/src/utils/timeline-source.ts +++ b/src/utils/timeline-source.ts @@ -49,15 +49,18 @@ export class TimelineDataSource { protected _cameraIDs: Set; protected _mediaType: ClipsOrSnapshotsOrAll; + protected _showRecordings: boolean; constructor( cameraManager: CameraManager, cameraIDs: Set, media: ClipsOrSnapshotsOrAll, + showRecordings: boolean, ) { this._cameraManager = cameraManager; this._cameraIDs = cameraIDs; this._mediaType = media; + this._showRecordings = showRecordings; } get dataset(): DataSet { @@ -83,7 +86,7 @@ export class TimelineDataSource { try { await Promise.all([ this._refreshEvents(hass, window), - this._refreshRecordings(hass, window), + ...(this._showRecordings ? [this._refreshRecordings(hass, window)] : []), ]); } catch (e) { errorToConsole(e as Error);