Move frigate util under the camera manager hierarchy.
This commit is contained in:
@@ -3,9 +3,8 @@ import fromUnixTime from 'date-fns/fromUnixTime';
|
||||
import startOfHour from 'date-fns/startOfHour';
|
||||
import sub from 'date-fns/sub';
|
||||
import { ViewContext } from 'view';
|
||||
import { CameraConfig, ClipsOrSnapshotsOrAll, FrigateCardView } from '../types';
|
||||
import { CameraConfig, ClipsOrSnapshotsOrAll, FrigateCardView, RecordingSegment } from '../types';
|
||||
import { EventMediaQueries, RecordingMediaQueries, View } from '../view';
|
||||
import { RecordingSegments } from '../camera/frigate/frigate';
|
||||
import { CameraManager } from '../camera/manager';
|
||||
import { getAllDependentCameras } from './camera.js';
|
||||
import { ViewMedia, ViewMediaClassifier } from '../view-media';
|
||||
@@ -279,7 +278,7 @@ export const findClosestMediaIndex = (
|
||||
const getSeekTimeInSegments = (
|
||||
startTime: Date,
|
||||
targetTime: Date,
|
||||
segments: RecordingSegments,
|
||||
segments: RecordingSegment[],
|
||||
): number | null => {
|
||||
if (!segments.length) {
|
||||
return null;
|
||||
|
||||
@@ -3,10 +3,9 @@ import add from 'date-fns/add';
|
||||
import sub from 'date-fns/sub';
|
||||
import { DataSet } from 'vis-data';
|
||||
import { IdType, TimelineItem, TimelineWindow } from 'vis-timeline/esnext';
|
||||
import { CameraConfig, ClipsOrSnapshotsOrAll } from '../types';
|
||||
import { CameraConfig, ClipsOrSnapshotsOrAll, RecordingSegment } from '../types';
|
||||
import { CameraManager } from '../camera/manager';
|
||||
import { EventQuery } from '../camera/types';
|
||||
import { RecordingSegment, RecordingSegments } from '../camera/frigate/frigate';
|
||||
import { capEndDate, convertRangeToCacheFriendlyTimes } from '../camera/util';
|
||||
import { EventMediaQueries } from '../view';
|
||||
import { ViewMedia } from '../view-media';
|
||||
@@ -228,9 +227,9 @@ export class TimelineDataSource {
|
||||
|
||||
const results = await this._cameraManager.getRecordingSegments(hass, queries);
|
||||
|
||||
const newSegments: Map<string, RecordingSegments> = new Map();
|
||||
const newSegments: Map<string, RecordingSegment[]> = new Map();
|
||||
for (const [query, result] of results) {
|
||||
let destination: RecordingSegments | undefined = newSegments.get(query.cameraID);
|
||||
let destination: RecordingSegment[] | undefined = newSegments.get(query.cameraID);
|
||||
if (!destination) {
|
||||
destination = [];
|
||||
newSegments.set(query.cameraID, destination);
|
||||
|
||||
Reference in New Issue
Block a user