@@ -213,11 +213,11 @@ export class FrigateCardThumbnailDetailsRecording extends LitElement {
return html`
${this.cameraTitle ?? ''}
${this.seek
- ? html`
+ ? html`
${localize('recording.seek')}
${format(this.seek, 'HH:mm:ss')}
`
- : html``}
+ : html``}
${eventCount !== null
? html`
@@ -303,50 +303,50 @@ export class FrigateCardThumbnail extends LitElement {
.thumbnail=${thumbnail ?? undefined}
>`
: ViewMediaClassifier.isRecording(this.media)
- ? html``
- : html``}
+ : html``}
${shouldShowFavoriteControl
- ? html` {
- stopEventFromActivatingCardWideActions(ev);
- if (this.hass && this.media) {
- try {
- await this.cameraManager?.favoriteMedia(
- this.hass,
- this.media,
- !this.media?.isFavorite(),
- );
- } catch (e) {
- errorToConsole(e as Error);
- return;
- }
- this.requestUpdate();
+ stopEventFromActivatingCardWideActions(ev);
+ if (this.hass && this.media) {
+ try {
+ await this.cameraManager?.favoriteMedia(
+ this.hass,
+ this.media,
+ !this.media?.isFavorite(),
+ );
+ } catch (e) {
+ errorToConsole(e as Error);
+ return;
}
- }}
+ this.requestUpdate();
+ }
+ }}
/>`
- : ``}
+ : ``}
${this.details && ViewMediaClassifier.isEvent(this.media)
- ? html``
- : this.details && ViewMediaClassifier.isRecording(this.media)
- ? html``
- : html``}
+ : html``}
${shouldShowTimelineControl
- ? html` media === this.media),
- })
- .removeContext('timeline')
- .dispatchChangeEvent(this);
- } else if (ViewMediaClassifier.isRecording(this.media)) {
- const startTime = this.media.getStartTime();
- const endTime = this.media.getStartTime();
- if (!startTime || !endTime) {
- return;
- }
- // Specifically reset the media target/childIndex, as we cannot
- // 'select' an hour in the timeline rather we set the window to
- // matching values.
- this.view
- ?.evolve({
- view: 'timeline',
- query: null,
- })
- .mergeInContext({
- timeline: {
- window: {
- start: startTime,
- end: endTime,
- },
- },
- })
- .dispatchChangeEvent(this);
- }
- }}
+ this.view
+ .evolve({
+ view: 'timeline',
+ queryResults: this.view.queryResults
+ ?.clone()
+ .selectResultIfFound((media) => media === this.media),
+ })
+ .removeContext('timeline')
+ .dispatchChangeEvent(this);
+ }
+ }
>`
- : ''}`;
+ : ''}`;
}
/**