feat: Add support for Frigate reviews / detections [initial PR] (#2315)
- Add support for Frigate reviews / detections. - Add support for GenAI metadata. - Significant internal refactor to more flexible "UnifiedQuery" to allow mixing cameras with simple metadata and review metadata (e.g. a timeline view of a Frigate camera with reviews, and a Reolink camera with simple metadata). - Add support for folder media as camera media. There are a few more PRs to commit prior to this going live, but commiting this for now due to the scale of the change. BREAKING CHANGE: `media_type` and `events_type` are retired under `live`, `viewer` and `timeline` configuration sections, instead media type is associated (once) with the camera under `media`.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
EventViewMedia,
|
||||
RecordingViewMedia,
|
||||
ReviewViewMedia,
|
||||
ViewFolder,
|
||||
ViewItem,
|
||||
ViewMedia,
|
||||
@@ -19,6 +20,9 @@ export class ViewItemClassifier {
|
||||
public static isRecording(item?: ViewItem | null): item is RecordingViewMedia {
|
||||
return this.isMedia(item) && item.getMediaType() === 'recording';
|
||||
}
|
||||
public static isReview(item?: ViewItem | null): item is ReviewViewMedia {
|
||||
return this.isMedia(item) && item.getMediaType() === 'review';
|
||||
}
|
||||
public static isClip(item?: ViewItem | null): boolean {
|
||||
return this.isMedia(item) && item.getMediaType() === 'clip';
|
||||
}
|
||||
@@ -26,6 +30,15 @@ export class ViewItemClassifier {
|
||||
return this.isMedia(item) && item.getMediaType() === 'snapshot';
|
||||
}
|
||||
public static isVideo(item?: ViewItem | null): boolean {
|
||||
return this.isMedia(item) && (this.isClip(item) || this.isRecording(item));
|
||||
return (
|
||||
this.isMedia(item) &&
|
||||
(this.isClip(item) ||
|
||||
this.isRecording(item) ||
|
||||
// Reviews always have a video.
|
||||
this.isReview(item))
|
||||
);
|
||||
}
|
||||
public static supportsTimeline(item?: ViewItem | null): item is ViewMedia {
|
||||
return this.isMedia(item) && !!item.getStartTime();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user