Merge pull request #852 from dermotduffy/download-recordings
Add ability to download recordings
This commit is contained in:
+24
-8
@@ -1030,8 +1030,9 @@ export class FrigateCard extends LitElement {
|
|||||||
|
|
||||||
if (this._cameras && (changedProps.has('_config') || changedProps.has('_cameras'))) {
|
if (this._cameras && (changedProps.has('_config') || changedProps.has('_cameras'))) {
|
||||||
this._timelineDataManager = new TimelineDataManager(
|
this._timelineDataManager = new TimelineDataManager(
|
||||||
this._cameras, this._config.timeline.media
|
this._cameras,
|
||||||
)
|
this._config.timeline.media,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1226,6 +1227,14 @@ export class FrigateCard extends LitElement {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cameraConfig = this._getSelectedCameraConfig();
|
||||||
|
if (!cameraConfig || !cameraConfig.frigate.camera_name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let path: string;
|
||||||
|
if (this._view.media.frigate?.event) {
|
||||||
const event_id = getEventID(this._view.media);
|
const event_id = getEventID(this._view.media);
|
||||||
if (!event_id) {
|
if (!event_id) {
|
||||||
this._setMessageAndUpdate({
|
this._setMessageAndUpdate({
|
||||||
@@ -1235,12 +1244,7 @@ export class FrigateCard extends LitElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cameraConfig = this._getSelectedCameraConfig();
|
path =
|
||||||
if (!cameraConfig) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const path =
|
|
||||||
`/api/frigate/${cameraConfig.frigate.client_id}` +
|
`/api/frigate/${cameraConfig.frigate.client_id}` +
|
||||||
`/notifications/${event_id}/` +
|
`/notifications/${event_id}/` +
|
||||||
`${
|
`${
|
||||||
@@ -1249,6 +1253,18 @@ export class FrigateCard extends LitElement {
|
|||||||
: 'snapshot.jpg'
|
: 'snapshot.jpg'
|
||||||
}` +
|
}` +
|
||||||
`?download=true`;
|
`?download=true`;
|
||||||
|
} else if (this._view.media.frigate?.recording) {
|
||||||
|
const recording = this._view.media.frigate.recording;
|
||||||
|
path =
|
||||||
|
`/api/frigate/${cameraConfig.frigate.client_id}` +
|
||||||
|
`/recording/${cameraConfig.frigate.camera_name}` +
|
||||||
|
`/start/${recording.start_time}` +
|
||||||
|
`/end/${recording.end_time}` +
|
||||||
|
`?download=true`;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let response: string | null | undefined;
|
let response: string | null | undefined;
|
||||||
try {
|
try {
|
||||||
response = await homeAssistantSignPath(this._hass, path);
|
response = await homeAssistantSignPath(this._hass, path);
|
||||||
|
|||||||
Reference in New Issue
Block a user