Refactor Frigate specific details out of ViewMediaBase.

This commit is contained in:
Dermot Duffy
2023-01-24 19:36:54 -08:00
parent 36f14e153c
commit f073f06789
9 changed files with 243 additions and 234 deletions
+2 -2
View File
@@ -128,7 +128,7 @@ export class FrigateCardThumbnailFeatureRecording extends LitElement {
@customElement('frigate-card-thumbnail-details-event')
export class FrigateCardThumbnailDetailsEvent extends LitElement {
@property({ attribute: false })
public media?: EventViewMedia;
public media?: EventViewMedia<unknown>;
@property({ attribute: false })
public mediaSeek?: MediaSeek;
@@ -180,7 +180,7 @@ export class FrigateCardThumbnailDetailsEvent extends LitElement {
@customElement('frigate-card-thumbnail-details-recording')
export class FrigateCardThumbnailDetailsRecording extends LitElement {
@property({ attribute: false })
public media?: RecordingViewMedia;
public media?: RecordingViewMedia<unknown>;
@property({ attribute: false })
public mediaSeek?: MediaSeek;
+5 -2
View File
@@ -374,8 +374,11 @@ export class FrigateCardViewerCarousel extends LitElement {
!media ||
// If this specific media item has no clip, then do nothing (even if all
// the other media items do).
!ViewMediaClassifier.isFrigateEvent(media) ||
!media.hasClip() ||
!ViewMediaClassifier.isEvent(media) ||
// If the event certainly has no clip, don't bother going further. If
// we're not sure for this camera type (i.e. hasClip() === null) the query
// will proceed anyway.
media.hasClip() === false ||
!MediaQueriesClassifier.areEventQueries(this.view.query)
) {
return;