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