diff --git a/README.md b/README.md index adf07ca8..54a4f106 100644 --- a/README.md +++ b/README.md @@ -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_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.| -| `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 diff --git a/src/types.ts b/src/types.ts index a0b26f60..99dfd490 100644 --- a/src/types.ts +++ b/src/types.ts @@ -773,7 +773,7 @@ const liveImageConfigDefault = { const liveThumbnailControlsDefaults = { ...thumbnailControlsDefaults, - media: 'clips' as const, + media: 'all' as const, }; const liveConfigDefault = { @@ -804,7 +804,7 @@ const liveConfigDefault = { const livethumbnailsControlSchema = thumbnailsControlSchema.extend({ media: z - .enum(['clips', 'snapshots']) + .enum(['all', 'clips', 'snapshots']) .default(liveConfigDefault.controls.thumbnails.media), }); diff --git a/src/utils/media-to-view.ts b/src/utils/media-to-view.ts index ba1df50d..164e3150 100644 --- a/src/utils/media-to-view.ts +++ b/src/utils/media-to-view.ts @@ -54,9 +54,7 @@ export const createViewForEvents = async ( const queries = cameraManager.generateDefaultEventQueries(cameraIDs, { ...(options?.limit && { limit: options.limit }), - ...((!options?.mediaType || ['clips', 'all'].includes(options.mediaType)) && { - hasClip: true, - }), + ...(options?.mediaType === 'clips' && { hasClip: true }), ...(options?.mediaType === 'snapshots' && { hasSnapshot: true }), }); query = new EventMediaQueries(queries); diff --git a/src/view/view.ts b/src/view/view.ts index ba038822..53b159bb 100644 --- a/src/view/view.ts +++ b/src/view/view.ts @@ -1,5 +1,4 @@ // 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: 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()