- 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`.
33 lines
928 B
TypeScript
33 lines
928 B
TypeScript
import { ViewMedia } from '../../view/item';
|
|
import {
|
|
FrigateEventViewMedia,
|
|
FrigateRecordingViewMedia,
|
|
FrigateReviewViewMedia,
|
|
} from './media';
|
|
|
|
export class FrigateViewMediaClassifier {
|
|
public static isFrigateMedia(
|
|
media: ViewMedia,
|
|
): media is
|
|
| FrigateEventViewMedia
|
|
| FrigateRecordingViewMedia
|
|
| FrigateReviewViewMedia {
|
|
return (
|
|
this.isFrigateEvent(media) ||
|
|
this.isFrigateRecording(media) ||
|
|
this.isFrigateReview(media)
|
|
);
|
|
}
|
|
public static isFrigateEvent(media: ViewMedia): media is FrigateEventViewMedia {
|
|
return media instanceof FrigateEventViewMedia;
|
|
}
|
|
public static isFrigateRecording(
|
|
media: ViewMedia,
|
|
): media is FrigateRecordingViewMedia {
|
|
return media instanceof FrigateRecordingViewMedia;
|
|
}
|
|
public static isFrigateReview(media: ViewMedia): media is FrigateReviewViewMedia {
|
|
return media instanceof FrigateReviewViewMedia;
|
|
}
|
|
}
|