Support 'all' as media type for live thumbnails.

This commit is contained in:
Dermot Duffy
2023-01-24 19:36:54 -08:00
parent 65aa9716fc
commit 0f5f5b7ddf
4 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -392,7 +392,7 @@ live:
| `show_details` | `false` | :white_check_mark: | Whether to show event details (e.g. duration, start time, object detected, etc) alongside the thumbnail.| | `show_details` | `false` | :white_check_mark: | Whether to show event details (e.g. duration, start time, object detected, etc) alongside the thumbnail.|
| `show_favorite_control` | `true` | :white_check_mark: | Whether to show the favorite ('star') control on each thumbnail.| | `show_favorite_control` | `true` | :white_check_mark: | Whether to show the favorite ('star') control on each thumbnail.|
| `show_timeline_control` | `true` | :white_check_mark: | Whether to show the timeline ('target') control on each thumbnail.| | `show_timeline_control` | `true` | :white_check_mark: | Whether to show the timeline ('target') control on each thumbnail.|
| `media` | `clips` | :white_check_mark: | Whether to show `clips` or `snapshots` in the thumbnail carousel in the `live` view.| | `media` | `all` | :white_check_mark: | Whether to show `clips`, `snapshots` or `all` in the thumbnail carousel in the `live` view.|
#### Live Controls: Next / Previous #### Live Controls: Next / Previous
+2 -2
View File
@@ -773,7 +773,7 @@ const liveImageConfigDefault = {
const liveThumbnailControlsDefaults = { const liveThumbnailControlsDefaults = {
...thumbnailControlsDefaults, ...thumbnailControlsDefaults,
media: 'clips' as const, media: 'all' as const,
}; };
const liveConfigDefault = { const liveConfigDefault = {
@@ -804,7 +804,7 @@ const liveConfigDefault = {
const livethumbnailsControlSchema = thumbnailsControlSchema.extend({ const livethumbnailsControlSchema = thumbnailsControlSchema.extend({
media: z media: z
.enum(['clips', 'snapshots']) .enum(['all', 'clips', 'snapshots'])
.default(liveConfigDefault.controls.thumbnails.media), .default(liveConfigDefault.controls.thumbnails.media),
}); });
+1 -3
View File
@@ -54,9 +54,7 @@ export const createViewForEvents = async (
const queries = cameraManager.generateDefaultEventQueries(cameraIDs, { const queries = cameraManager.generateDefaultEventQueries(cameraIDs, {
...(options?.limit && { limit: options.limit }), ...(options?.limit && { limit: options.limit }),
...((!options?.mediaType || ['clips', 'all'].includes(options.mediaType)) && { ...(options?.mediaType === 'clips' && { hasClip: true }),
hasClip: true,
}),
...(options?.mediaType === 'snapshots' && { hasSnapshot: true }), ...(options?.mediaType === 'snapshots' && { hasSnapshot: true }),
}); });
query = new EventMediaQueries(queries); query = new EventMediaQueries(queries);
-1
View File
@@ -1,5 +1,4 @@
// Easy: // Easy:
// - TODO: Should be able to set live media to 'all' and have it work.
// - TODO: Are there elements of ViewMedia (e.g. getEventCount) that should be moved into subclasses (e.g. a recording subclass). // - TODO: Are there elements of ViewMedia (e.g. getEventCount) that should be moved into subclasses (e.g. a recording subclass).
// - TODO: In MediaQueriesBase, do we need to generic? Just have T be a MediaQuery? // - TODO: In MediaQueriesBase, do we need to generic? Just have T be a MediaQuery?
// - TODO: In the viewer @click handlers should I use this.selected instead of calling carouselScrollPrevious() // - TODO: In the viewer @click handlers should I use this.selected instead of calling carouselScrollPrevious()