Add initial media filtering for the gallery.
This commit is contained in:
@@ -268,13 +268,14 @@ export class FrigateCameraManagerEngine implements CameraManagerEngine {
|
||||
const nativeQuery: NativeFrigateEventQuery = {
|
||||
instance_id: instanceID,
|
||||
cameras: Array.from(this._getFrigateCameraNamesForCameraIDs(cameras, cameraIDs)),
|
||||
...(query.what && { label: Array.from(query.what) }),
|
||||
...(query.where && { zone: Array.from(query.where) }),
|
||||
...(query.what && { labels: Array.from(query.what) }),
|
||||
...(query.where && { zones: Array.from(query.where) }),
|
||||
...(query.end && { before: Math.floor(query.end.getTime() / 1000) }),
|
||||
...(query.start && { after: Math.floor(query.start.getTime() / 1000) }),
|
||||
...(query.limit && { limit: query.limit }),
|
||||
...(query.hasClip && { has_clip: query.hasClip }),
|
||||
...(query.hasSnapshot && { has_snapshot: query.hasSnapshot }),
|
||||
...(query.favorite && { favorites: query.favorite }),
|
||||
limit: query?.limit ?? CAMERA_MANAGER_ENGINE_EVENT_LIMIT_DEFAULT,
|
||||
};
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ export interface NativeFrigateEventQuery {
|
||||
limit?: number;
|
||||
has_clip?: boolean;
|
||||
has_snapshot?: boolean;
|
||||
favorites?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,31 +87,31 @@ export class CameraManager {
|
||||
|
||||
public generateDefaultEventQueries(
|
||||
cameraIDs: string | Set<string>,
|
||||
partialQuery: PartialEventQuery,
|
||||
partialQuery?: PartialEventQuery,
|
||||
): EventQuery[] | null {
|
||||
return this._generateDefaultQueries(cameraIDs, {
|
||||
...partialQuery,
|
||||
type: QueryType.Event,
|
||||
...partialQuery,
|
||||
});
|
||||
}
|
||||
|
||||
public generateDefaultRecordingQueries(
|
||||
cameraIDs: string | Set<string>,
|
||||
partialQuery: PartialRecordingQuery,
|
||||
partialQuery?: PartialRecordingQuery,
|
||||
): RecordingQuery[] | null {
|
||||
return this._generateDefaultQueries(cameraIDs, {
|
||||
...partialQuery,
|
||||
type: QueryType.Recording,
|
||||
...partialQuery,
|
||||
});
|
||||
}
|
||||
|
||||
public generateDefaultRecordingSegmentsQueries(
|
||||
cameraIDs: string | Set<string>,
|
||||
partialQuery: PartialRecordingSegmentsQuery,
|
||||
partialQuery?: PartialRecordingSegmentsQuery,
|
||||
): RecordingSegmentsQuery[] | null {
|
||||
return this._generateDefaultQueries(cameraIDs, {
|
||||
...partialQuery,
|
||||
type: QueryType.RecordingSegments,
|
||||
...partialQuery,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ export interface EventQuery extends MediaQuery {
|
||||
|
||||
// Frigate equivalent: zone
|
||||
where?: Set<string>;
|
||||
|
||||
favorite?: boolean;
|
||||
}
|
||||
export type PartialEventQuery = Partial<EventQuery>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user