Merge pull request #931 from dermotduffy/fix-timeline-for-recordings
Fix timeline button for recordings
This commit is contained in:
@@ -355,7 +355,6 @@ export class FrigateCardThumbnail extends LitElement {
|
|||||||
if (!this.view || !this.media) {
|
if (!this.view || !this.media) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ViewMediaClassifier.isEvent(this.media)) {
|
|
||||||
this.view
|
this.view
|
||||||
.evolve({
|
.evolve({
|
||||||
view: 'timeline',
|
view: 'timeline',
|
||||||
@@ -365,31 +364,8 @@ export class FrigateCardThumbnail extends LitElement {
|
|||||||
})
|
})
|
||||||
.removeContext('timeline')
|
.removeContext('timeline')
|
||||||
.dispatchChangeEvent(this);
|
.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);
|
|
||||||
}
|
}
|
||||||
}}
|
|
||||||
></ha-icon>`
|
></ha-icon>`
|
||||||
: ''}`;
|
: ''}`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user