Recalculate timeline cameras when display mode changes.

This commit is contained in:
Dermot Duffy
2023-09-04 19:51:15 -07:00
parent d425457781
commit 07bc6391ec
3 changed files with 6 additions and 8 deletions
-2
View File
@@ -1,5 +1,3 @@
// TODO: Live non-grid -> live grid -> timeline is different from when the timeline is dragged.
import { import {
CSSResultGroup, CSSResultGroup,
html, html,
+6 -4
View File
@@ -113,12 +113,14 @@ export class FrigateCardSurround extends LitElement {
import('./timeline.js'); import('./timeline.js');
} }
// Only reset the timeline cameraIDs when the media materially changes (and // Only reset the timeline cameraIDs when the media or display mode
// not on every view change, since the view will change frequently when the // materially changes (and not on every view change, since the view will
// user is scrubbing video). // change frequently when the user is scrubbing video).
const oldView = changedProperties.get('view');
if ( if (
changedProperties.has('view') && changedProperties.has('view') &&
View.isMajorMediaChange(changedProperties.get('view'), this.view) (View.isMajorMediaChange(oldView, this.view) ||
oldView.displayMode !== this.view?.displayMode)
) { ) {
this._cameraIDsForTimeline = this._getCameraIDsForTimeline() ?? undefined; this._cameraIDsForTimeline = this._getCameraIDsForTimeline() ?? undefined;
} }
-2
View File
@@ -1221,8 +1221,6 @@ export class FrigateCardTimelineCore extends LitElement {
createdTimeline = true; createdTimeline = true;
const noGroups = this.mini && groups.length === 1; const noGroups = this.mini && groups.length === 1;
if (noGroups) { if (noGroups) {
// In a mini timeline, if there's only one group don't bother grouping
// at all.
this._timeline = new Timeline( this._timeline = new Timeline(
this._refTimeline.value, this._refTimeline.value,
this._timelineSource.dataset, this._timelineSource.dataset,