Use query type instead of view.
This commit is contained in:
@@ -168,7 +168,7 @@ export class FrigateCardSurround extends LitElement {
|
||||
if (media) {
|
||||
this.view
|
||||
?.evolve({
|
||||
view: this.view.is('recording') ? 'recording' : 'media',
|
||||
view: 'media',
|
||||
queryResults: ev.detail.queryResults,
|
||||
...(media.getCameraID() && { camera: media.getCameraID() }),
|
||||
})
|
||||
|
||||
@@ -496,7 +496,7 @@ export class FrigateCardTimelineCore extends LitElement {
|
||||
} else if (
|
||||
properties.item &&
|
||||
properties.what === 'item' &&
|
||||
this.view.is('recording')
|
||||
this.view.query?.areRecordingQueries()
|
||||
) {
|
||||
viewPromise = (async (): Promise<View | null> => {
|
||||
if (!properties.item || !this.dataManager || !this.hass) {
|
||||
@@ -606,7 +606,7 @@ export class FrigateCardTimelineCore extends LitElement {
|
||||
// Don't show event thumbnails if the user is looking at recordings,
|
||||
// as the recording "hours" are the media, not the event
|
||||
// clips/snapshots.
|
||||
if (this._timeline && this.view && !this.view?.is('recording')) {
|
||||
if (this._timeline && this.view && !this.view.query?.areRecordingQueries()) {
|
||||
(
|
||||
await this._createViewWithEventMediaQuery(
|
||||
this._createEventMediaQuerys({ window: prefetchedWindow }),
|
||||
@@ -967,7 +967,7 @@ export class FrigateCardTimelineCore extends LitElement {
|
||||
|
||||
if (
|
||||
!this.mini &&
|
||||
!this.view.is('recording') &&
|
||||
!this.view.query?.areRecordingQueries() &&
|
||||
freshMediaQuery &&
|
||||
!this._alreadyHasAcceptableMediaQuery(freshMediaQuery)
|
||||
) {
|
||||
|
||||
@@ -124,7 +124,7 @@ export class FrigateCardViewer extends LitElement {
|
||||
// search for. When the query *is* specified, the view is not required to
|
||||
// indicate the media type (e.g. the mixed 'media' view from the
|
||||
// timeline).
|
||||
const mediaType = this.view.getMediaType();
|
||||
const mediaType = this.view.getDefaultMediaType();
|
||||
if (!browseMediaQueryParameters || !mediaType) {
|
||||
return;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ export class FrigateCardViewer extends LitElement {
|
||||
this.cameras,
|
||||
this.view,
|
||||
{
|
||||
targetView: mediaType === 'clips' ? 'clip' : 'snapshot',
|
||||
targetView: 'media',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user