Merge pull request #489 from NickM-27/favorite-clips

Add favorite icon for clips that are retained
This commit is contained in:
Dermot Duffy
2022-03-20 18:06:06 -07:00
committed by GitHub
5 changed files with 29 additions and 1 deletions
+4 -1
View File
@@ -218,7 +218,10 @@ export class FrigateCardGalleryCore extends LitElement {
}
stopEventFromActivatingCardWideActions(ev);
}}
/>`
/>${child.frigate?.event?.retain_indefinitely ? html`<ha-icon
class="favorite"
icon="mdi:star"
/>` : ``}`
: ``}
</div>
</li>`,
+5
View File
@@ -127,6 +127,11 @@ export class FrigateCardThumbnailCarousel extends FrigateCardCarousel {
src="${mediaToRender.thumbnail}"
title="${mediaToRender.title}"
/>
${mediaToRender?.frigate?.event?.retain_indefinitely ? html`
<ha-icon
class="favorite"
icon="mdi:star"
/>` : ``}
</div>`;
}
+9
View File
@@ -44,3 +44,12 @@ ha-card.frigate-card-gallery-folder {
height: 100%;
line-height: 1;
}
.favorite {
position: absolute;
transform: translate(-50%, -50%);
height: 24px;
width: 24px;
top: 10%;
left: 90%;
color: yellow;
}
+9
View File
@@ -26,3 +26,12 @@
max-width: var(--frigate-card-carousel-thumbnail-size);
max-height: var(--frigate-card-carousel-thumbnail-size);
}
.favorite {
position: absolute;
transform: translate(-50%, -50%);
height: 24px;
width: 24px;
top: 12%;
left: 90%;
color: yellow;
}
+2
View File
@@ -946,6 +946,7 @@ export interface FrigateBrowseMediaSource extends BrowseMediaSource {
start_time: number;
top_score: number;
zones: string[];
retain_indefinitely: boolean;
};
};
}
@@ -975,6 +976,7 @@ export const frigateBrowseMediaSourceSchema: z.ZodSchema<BrowseMediaSource> = z.
start_time: z.number(),
top_score: z.number(),
zones: z.string().array(),
retain_indefinitely: z.boolean(),
}),
})
.optional(),