Move more static information into the media.

This commit is contained in:
Dermot Duffy
2023-01-24 19:36:54 -08:00
parent 7896dfeb3c
commit a718e5febe
9 changed files with 119 additions and 97 deletions
+15
View File
@@ -82,3 +82,18 @@ export const getRecordingMediaContentID = (
String(recording.startTime.getHours()).padStart(2, '0'),
].join('/');
};
/**
* Get a recording ID for internal de-duping.
*/
export const getRecordingID = (
cameraConfig: CameraConfig,
recording: FrigateRecording,
): string => {
// ID name is derived from the real camera name (not CameraID) since the
// recordings for the same camera across multiple zones will be the same and
// can be dedup'd from this id.
return `${cameraConfig.frigate?.client_id ?? ''}/${
cameraConfig.frigate.camera_name ?? ''
}/${recording.startTime.getTime()}/${recording.endTime.getTime()}}`;
};