Add download control to thumbnails.

This commit is contained in:
Dermot Duffy
2023-03-12 20:28:46 -07:00
parent f53490a70c
commit e1f146b560
17 changed files with 354 additions and 216 deletions
+6 -2
View File
@@ -245,7 +245,7 @@ const frigateCardLiveDependencySelectActionSchema =
frigate_card_action: z.literal('live_substream_select'),
camera: z.string(),
});
const frigateCarMediaPlayerActionSchema = frigateCardCustomActionsBaseSchema.extend({
const frigateCardMediaPlayerActionSchema = frigateCardCustomActionsBaseSchema.extend({
frigate_card_action: z.literal('media_player'),
media_player: z.string(),
media_player_action: z.enum(['play', 'stop']),
@@ -255,7 +255,7 @@ export const frigateCardCustomActionSchema = z.union([
frigateCardGeneralActionSchema,
frigateCardCameraSelectActionSchema,
frigateCardLiveDependencySelectActionSchema,
frigateCarMediaPlayerActionSchema,
frigateCardMediaPlayerActionSchema,
]);
export type FrigateCardCustomAction = z.infer<typeof frigateCardCustomActionSchema>;
@@ -747,6 +747,7 @@ const thumbnailControlsDefaults = {
show_details: true,
show_favorite_control: true,
show_timeline_control: true,
show_download_control: true,
};
const thumbnailsControlSchema = z.object({
@@ -765,6 +766,9 @@ const thumbnailsControlSchema = z.object({
show_timeline_control: z
.boolean()
.default(thumbnailControlsDefaults.show_timeline_control),
show_download_control: z
.boolean()
.default(thumbnailControlsDefaults.show_download_control),
});
export type ThumbnailsControlConfig = z.infer<typeof thumbnailsControlSchema>;