Don't pass cameraConfig in with favouriteMedia request.
This commit is contained in:
@@ -236,10 +236,13 @@ export class CameraManager {
|
||||
|
||||
public async favoriteMedia(
|
||||
hass: HomeAssistant,
|
||||
cameraConfig: CameraConfig,
|
||||
media: ViewMedia,
|
||||
favorite: boolean,
|
||||
): Promise<void> {
|
||||
const cameraConfig = this._cameras.get(media.getCameraID());
|
||||
if (!cameraConfig) {
|
||||
return;
|
||||
}
|
||||
const engine = this._engineFactory.getEngineForCamera(cameraConfig);
|
||||
if (engine) {
|
||||
const queryStartTime = new Date();
|
||||
|
||||
@@ -296,11 +296,10 @@ export class FrigateCardThumbnail extends LitElement {
|
||||
title=${localize('thumbnail.retain_indefinitely')}
|
||||
@click=${async (ev: Event) => {
|
||||
stopEventFromActivatingCardWideActions(ev);
|
||||
if (this.hass && this.cameraConfig && this.media) {
|
||||
if (this.hass && this.media) {
|
||||
try {
|
||||
await this.cameraManager?.favoriteMedia(
|
||||
this.hass,
|
||||
this.cameraConfig,
|
||||
this.media,
|
||||
!this.media?.isFavorite(),
|
||||
);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// - TODO: Add garbage collecting of segments not present in the recording summaries anymore.
|
||||
// - TODO: Move frigate specific view-media under the camera manager.
|
||||
// - TODO: ts-prune https://camchenry.com/blog/deleting-dead-code-in-typescript
|
||||
// - TODO: Engine should not need cameraConfig to favorite since it already has cameras.
|
||||
|
||||
// Hard:
|
||||
// - TODO: Implement dragging the timeline seeking forward in both Frigate recordings & events.
|
||||
|
||||
Reference in New Issue
Block a user