Fetch timeline events from events endpoint not media browser.

This commit is contained in:
Dermot Duffy
2022-09-24 11:31:03 -07:00
parent 0491018aab
commit a2e80d93a3
13 changed files with 300 additions and 165 deletions
+6 -2
View File
@@ -32,7 +32,7 @@ import './surround-basic.js';
import './timeline-core.js';
interface ThumbnailViewContext {
// Whetherr or not to fetch thumbnails.
// Whether or not to fetch thumbnails.
fetch?: boolean;
}
@@ -59,6 +59,9 @@ export class FrigateCardSurround extends LitElement {
@property({ attribute: false })
public inBackground?: boolean;
@property({ attribute: false })
public fetch = false;
@property({ attribute: false, hasChanged: contentsChanged })
public browseMediaParams?: BrowseMediaQueryParameters | BrowseMediaQueryParameters[];
@@ -76,12 +79,13 @@ export class FrigateCardSurround extends LitElement {
*/
protected async _fetchMedia(): Promise<void> {
if (
!this.fetch ||
this.inBackground ||
!this.hass ||
!this.view ||
this.view.target ||
!this.thumbnailConfig ||
this.thumbnailConfig.mode === 'none' ||
this.view.target ||
!this.browseMediaParams ||
!(this.view.context?.thumbnails?.fetch ?? true)
) {