Files
advanced-camera-card/src/utils/folder.ts
T
Dermot Duffy fc32727860 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`.
2026-01-19 13:32:50 -08:00

18 lines
544 B
TypeScript

import { FolderConfig } from '../config/schema/folders';
import { RawAdvancedCameraCardConfig } from '../config/types';
/**
* Get a folder id.
* @param config The folder config (either parsed or raw).
* @param index The index of the folder in the config array (used for default ID).
* @returns A folder id.
*/
export function getFolderID(
config?: FolderConfig | RawAdvancedCameraCardConfig | null,
index?: number,
): string {
return (
(typeof config?.id === 'string' && config.id) || `folder/${(index ?? 0).toString()}`
);
}