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:
@@ -6,11 +6,11 @@ import { createFolder, TestViewMedia } from '../test-utils';
|
||||
describe('ViewItemClassifier', () => {
|
||||
it('isMedia', () => {
|
||||
expect(ViewItemClassifier.isMedia(new TestViewMedia())).toBe(true);
|
||||
expect(ViewItemClassifier.isMedia(new ViewFolder(createFolder()))).toBe(false);
|
||||
expect(ViewItemClassifier.isMedia(new ViewFolder(createFolder(), []))).toBe(false);
|
||||
});
|
||||
|
||||
it('isFolder', () => {
|
||||
expect(ViewItemClassifier.isFolder(new ViewFolder(createFolder()))).toBe(true);
|
||||
expect(ViewItemClassifier.isFolder(new ViewFolder(createFolder(), []))).toBe(true);
|
||||
expect(ViewItemClassifier.isFolder(new TestViewMedia())).toBe(false);
|
||||
});
|
||||
|
||||
@@ -73,4 +73,40 @@ describe('ViewItemClassifier', () => {
|
||||
).toBe(expectedResult);
|
||||
});
|
||||
});
|
||||
|
||||
describe('supportsTimeline', () => {
|
||||
it('should return false when item is not a media item with a start time', () => {
|
||||
expect(ViewItemClassifier.supportsTimeline(null)).toBe(false);
|
||||
expect(ViewItemClassifier.supportsTimeline(undefined)).toBe(false);
|
||||
expect(
|
||||
ViewItemClassifier.supportsTimeline(new ViewFolder(createFolder(), [])),
|
||||
).toBe(false);
|
||||
expect(
|
||||
ViewItemClassifier.supportsTimeline(
|
||||
new TestViewMedia({ mediaType: ViewMediaType.Clip, startTime: null }),
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('should return true when item is a media item with a start time', () => {
|
||||
expect(
|
||||
ViewItemClassifier.supportsTimeline(
|
||||
new TestViewMedia({ mediaType: ViewMediaType.Clip, startTime: new Date() }),
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
ViewItemClassifier.supportsTimeline(
|
||||
new TestViewMedia({ mediaType: ViewMediaType.Review, startTime: new Date() }),
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
ViewItemClassifier.supportsTimeline(
|
||||
new TestViewMedia({
|
||||
mediaType: ViewMediaType.Recording,
|
||||
startTime: new Date(),
|
||||
}),
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user