Move seeking support into the engine.

This commit is contained in:
Dermot Duffy
2023-01-24 19:36:54 -08:00
parent 13816c3025
commit 6b2036676c
12 changed files with 142 additions and 176 deletions
+2 -4
View File
@@ -87,12 +87,11 @@ export class TimelineDataSource {
public async refresh(
hass: HomeAssistant,
cameras: Map<string, CameraConfig>,
window: TimelineWindow,
): Promise<void> {
try {
await Promise.all([
this._refreshEvents(hass, cameras, window),
this._refreshEvents(hass, window),
this._refreshRecordings(hass, window),
]);
} catch (e) {
@@ -122,7 +121,6 @@ export class TimelineDataSource {
protected async _refreshEvents(
hass: HomeAssistant,
cameras: Map<string, CameraConfig>,
window: TimelineWindow,
): Promise<void> {
if (
@@ -145,7 +143,7 @@ export class TimelineDataSource {
for (const media of results?.getResults() ?? []) {
const endTime = media.getEndTime();
const startTime = media.getStartTime();
const id = media.getID(cameras.get(media.getCameraID()));
const id = media.getID();
if (id && startTime) {
this._dataset.update({
id: id,