diff --git a/README.md b/README.md index 04dee783..cd9857e2 100644 --- a/README.md +++ b/README.md @@ -544,29 +544,31 @@ media_viewer: | `mode` | `popup-bottom-right` | :heavy_multiplication_x: | How to display the Media viewer media title. Acceptable values: `none`, `popup-top-left`, `popup-top-right`, `popup-bottom-left`, `popup-bottom-right` . | | `duration_seconds` | `2` | :heavy_multiplication_x: | The number of seconds to display the title popup. `0` implies forever.| -### Event Gallery Options + -The `event_gallery` is used for providing an overview of all `clips`, `snapshots` and `recordings` in a thumbnail gallery. +### Media Gallery Options + +The `media_gallery` is used for providing an overview of all `clips`, `snapshots` and `recordings` in a thumbnail gallery. All configuration is under: ```yaml -event_gallery: +media_gallery: ``` -See the [fully expanded event gallery configuration example](#config-expanded-event-gallery) for how these parameters are structured. +See the [fully expanded media gallery configuration example](#config-expanded-media-gallery) for how these parameters are structured. | Option | Default | Overridable | Description | | - | - | - | - | | `controls` | | :heavy_multiplication_x: | Configuration for the Media viewer controls. See below. | -| `actions` | | :heavy_multiplication_x: | Actions to use for all views that use the `event_gallery` (e.g. `clips`, `snapshots`, `recordings`). See [actions](#actions) below.| +| `actions` | | :heavy_multiplication_x: | Actions to use for all views that use the `media_gallery` (e.g. `clips`, `snapshots`, `recordings`). See [actions](#actions) below.| -#### Event Gallery Controls: Filter +#### Media Gallery Controls: Filter All configuration is under: ```yaml -event_gallery: +media_gallery: controls: filter: ``` @@ -575,12 +577,12 @@ event_gallery: | - | - | - | - | | `mode` | `right` | :heavy_multiplication_x: | Whether to show the gallery media filter to the `left`, to the `right` or `none` for no media filter. | -#### Event Gallery Controls: Thumbnails +#### Media Gallery Controls: Thumbnails All configuration is under: ```yaml -event_gallery: +media_gallery: controls: thumbnails: ``` @@ -744,7 +746,7 @@ Style performance options request the card minimize certain expensive CSS stylings. This does not necessarily disable these stylings _entirely_ since that may break the basic expected visuals of the card (e.g. menu icons need curves), but rather avoids use of them in high item-count situations (e.g. avoiding -shadows on timeline items, or curves in the event gallery items). +shadows on timeline items, or curves in the media gallery items). All configuration is under: @@ -1080,12 +1082,12 @@ This card supports several different views: | Key | Description | | ------------- | --------------------------------------------- | |`live` (default)| Shows the live camera view with the configured live provider.| -|`snapshots`|Shows an event gallery of snapshots for this camera/zone/label.| -|`snapshot`|Shows a Media viewer for the most recent snapshot for this camera/zone/label. Can also be accessed by holding down the `snapshots` menu icon.| -|`clips`|Shows an event gallery of clips for this camera/zone/label.| -|`clip`|Shows a Media viewer for the most recent clip for this camera/zone/label. Can also be accessed by holding down the `clips` menu icon.| +|`snapshots`|Shows a gallery of snapshots for this camera/zone/label.| +|`snapshot`|Shows a viewer for the most recent snapshot for this camera/zone/label. Can also be accessed by holding down the `snapshots` menu icon.| +|`clips`|Shows a gallery of clips for this camera/zone/label.| +|`clip`|Shows a viewer for the most recent clip for this camera/zone/label. Can also be accessed by holding down the `clips` menu icon.| |`recordings`|Shows a gallery of recent (last day) recordings for this camera and its dependents.| -|`recording`|Shows a Media viewer for the most recent recording for this camera. Can also be accessed by holding down the `recordings` menu icon.| +|`recording`|Shows a viewer for the most recent recording for this camera. Can also be accessed by holding down the `recordings` menu icon.| |`image`|Shows a static image specified by the `image` parameter, can be used as a discrete default view or a screensaver (via `view.timeout_seconds`).| ### Navigating From A Snapshot To A Clip @@ -1146,8 +1148,8 @@ view. | Configuration path | Views to which it refers | | - | - | | `view.actions` | All (may be overriden by the below) | +| `media_gallery.actions` | `clips`, `snapshots`, `recordings` | | `media_viewer.actions` | `clip`, `snapshot`, `recording` | -| `event_gallery.actions` | `clips`, `snapshots`, `recordings` | | `live.actions` | `live` | | `image.actions` | `image` | @@ -1606,15 +1608,15 @@ media_viewer: ``` - +
- Expand: Event Gallery section + Expand: Media Gallery section -Reference: [Event Gallery Options](#event-gallery-options). +Reference: [Media Gallery Options](#media-gallery-options). ```yaml -event_gallery: +media_gallery: controls: filter: mode: 'right' diff --git a/src/card.ts b/src/card.ts index 3b2ce336..5d7e234b 100644 --- a/src/card.ts +++ b/src/card.ts @@ -1764,7 +1764,7 @@ class FrigateCard extends LitElement { if (this._view?.is('live')) { specificActions = this._getConfig().live.actions; } else if (this._view?.isGalleryView()) { - specificActions = this._getConfig().event_gallery?.actions; + specificActions = this._getConfig().media_gallery?.actions; } else if (this._view?.isViewerView()) { specificActions = this._getConfig().media_viewer.actions; } else if (this._view?.is('image')) { @@ -1893,7 +1893,7 @@ class FrigateCard extends LitElement { ? html` diff --git a/src/components/gallery.ts b/src/components/gallery.ts index 877e9a02..ff18a9c8 100644 --- a/src/components/gallery.ts +++ b/src/components/gallery.ts @@ -209,7 +209,7 @@ export class FrigateCardGalleryCore extends LitElement { protected _setColumnCount(): void { const thumbnailSize = this.galleryConfig?.controls.thumbnails.size ?? - frigateCardConfigDefaults.event_gallery.controls.thumbnails.size; + frigateCardConfigDefaults.media_gallery.controls.thumbnails.size; const columns = this.galleryConfig?.controls.thumbnails.show_details ? Math.max(1, Math.floor(this.clientWidth / THUMBNAIL_DETAILS_WIDTH_MIN)) : Math.max( diff --git a/src/config-mgmt.ts b/src/config-mgmt.ts index f6a7f16e..64c39f12 100644 --- a/src/config-mgmt.ts +++ b/src/config-mgmt.ts @@ -14,6 +14,7 @@ import { CONF_LIVE_LAZY_UNLOAD, CONF_LIVE_PRELOAD, CONF_LIVE_WEBRTC_CARD, + CONF_MEDIA_GALLERY, CONF_MEDIA_VIEWER, CONF_MENU, CONF_MENU_BUTTONS_CAMERAS, @@ -709,4 +710,5 @@ const UPGRADES = [ (data) => data.conditions as RawFrigateCardConfig | undefined, )(typeof data === 'object' && data ? data[CONF_ELEMENTS] : {}); }, + upgradeMoveToWithOverrides('event_gallery', CONF_MEDIA_GALLERY), ]; diff --git a/src/const.ts b/src/const.ts index a7f7ea95..17a77985 100644 --- a/src/const.ts +++ b/src/const.ts @@ -52,17 +52,17 @@ export const CONF_VIEW_SCAN_UNTRIGGER_RESET = export const CONF_VIEW_SCAN_UNTRIGGER_SECONDS = `${CONF_VIEW_SCAN}.untrigger_seconds` as const; -const CONF_EVENT_GALLERY = 'event_gallery' as const; -export const CONF_EVENT_GALLERY_CONTROLS_FILTER_MODE = - `${CONF_EVENT_GALLERY}.controls.filter.mode` as const; -export const CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS = - `${CONF_EVENT_GALLERY}.controls.thumbnails.show_details` as const; -export const CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL = - `${CONF_EVENT_GALLERY}.controls.thumbnails.show_favorite_control` as const; -export const CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL = - `${CONF_EVENT_GALLERY}.controls.thumbnails.show_timeline_control` as const; -export const CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SIZE = - `${CONF_EVENT_GALLERY}.controls.thumbnails.size` as const; +export const CONF_MEDIA_GALLERY = 'media_gallery' as const; +export const CONF_MEDIA_GALLERY_CONTROLS_FILTER_MODE = + `${CONF_MEDIA_GALLERY}.controls.filter.mode` as const; +export const CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS = + `${CONF_MEDIA_GALLERY}.controls.thumbnails.show_details` as const; +export const CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL = + `${CONF_MEDIA_GALLERY}.controls.thumbnails.show_favorite_control` as const; +export const CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL = + `${CONF_MEDIA_GALLERY}.controls.thumbnails.show_timeline_control` as const; +export const CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SIZE = + `${CONF_MEDIA_GALLERY}.controls.thumbnails.size` as const; export const CONF_MEDIA_VIEWER = 'media_viewer' as const; export const CONF_MEDIA_VIEWER_AUTO_PLAY = `${CONF_MEDIA_VIEWER}.auto_play` as const; diff --git a/src/editor.ts b/src/editor.ts index eaa09c47..8a456f90 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -32,11 +32,11 @@ import { CONF_CAMERAS_ARRAY_WEBRTC_CARD_URL, CONF_DIMENSIONS_ASPECT_RATIO, CONF_DIMENSIONS_ASPECT_RATIO_MODE, - CONF_EVENT_GALLERY_CONTROLS_FILTER_MODE, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SIZE, + CONF_MEDIA_GALLERY_CONTROLS_FILTER_MODE, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SIZE, CONF_IMAGE_LAYOUT_FIT, CONF_IMAGE_LAYOUT_POSITION_X, CONF_IMAGE_LAYOUT_POSITION_Y, @@ -158,8 +158,6 @@ const MENU_CAMERAS_DEPENDENCIES = 'cameras.dependencies'; const MENU_CAMERAS_FRIGATE = 'cameras.frigate'; const MENU_CAMERAS_TRIGGERS = 'cameras.triggers'; const MENU_CAMERAS_WEBRTC = 'cameras.webrtc'; -const MENU_EVENT_GALLERY_CONTROLS_THUMBNAILS = 'event_gallery.controls.thumbnails'; -const MENU_EVENT_GALLERY_CONTROLS_FILTER = 'event_gallery.controls.filter'; const MENU_IMAGE_LAYOUT = 'image.layout'; const MENU_LIVE_CONTROLS = 'live.controls'; const MENU_LIVE_CONTROLS_NEXT_PREVIOUS = 'live.controls.next_previous'; @@ -168,6 +166,8 @@ const MENU_LIVE_CONTROLS_TIMELINE = 'live.controls.timeline'; const MENU_LIVE_CONTROLS_TITLE = 'live.controls.title'; const MENU_LIVE_IMAGE = 'live.image'; const MENU_LIVE_LAYOUT = 'live.layout'; +const MENU_MEDIA_GALLERY_CONTROLS_THUMBNAILS = 'media_gallery.controls.thumbnails'; +const MENU_MEDIA_GALLERY_CONTROLS_FILTER = 'media_gallery.controls.filter'; const MENU_MEDIA_VIEWER_CONTROLS = 'media_viewer.controls'; const MENU_MEDIA_VIEWER_CONTROLS_NEXT_PREVIOUS = 'media_viewer.controls.next_previous'; const MENU_MEDIA_VIEWER_CONTROLS_THUMBNAILS = 'media_viewer.controls.thumbnails'; @@ -220,16 +220,16 @@ const options: EditorOptions = { name: localize('editor.live'), secondary: localize('editor.live_secondary'), }, + media_gallery: { + icon: 'grid', + name: localize('editor.media_gallery'), + secondary: localize('editor.media_gallery_secondary'), + }, media_viewer: { icon: 'filmstrip', name: localize('editor.media_viewer'), secondary: localize('editor.media_viewer_secondary'), }, - event_gallery: { - icon: 'grid', - name: localize('editor.event_gallery'), - secondary: localize('editor.event_gallery_secondary'), - }, image: { icon: 'image', name: localize('editor.image'), @@ -1680,20 +1680,20 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor ` : ''} - ${this._renderOptionSetHeader('event_gallery')} - ${this._expandedMenus[MENU_OPTIONS] === 'event_gallery' + ${this._renderOptionSetHeader('media_gallery')} + ${this._expandedMenus[MENU_OPTIONS] === 'media_gallery' ? html`
${this._renderThumbnailsControls( - MENU_EVENT_GALLERY_CONTROLS_THUMBNAILS, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SIZE, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL, - this._defaults.event_gallery.controls.thumbnails, + MENU_MEDIA_GALLERY_CONTROLS_THUMBNAILS, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SIZE, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL, + this._defaults.media_gallery.controls.thumbnails, )} ${this._renderFilterControls( - MENU_EVENT_GALLERY_CONTROLS_FILTER, - CONF_EVENT_GALLERY_CONTROLS_FILTER_MODE, + MENU_MEDIA_GALLERY_CONTROLS_FILTER, + CONF_MEDIA_GALLERY_CONTROLS_FILTER_MODE, )}
` : ''} diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index fd72dde3..dd775b04 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -123,7 +123,7 @@ "none": "No thumbnails", "right": "Thumbnails in a drawer to the right" }, - "show_details": "Show event details with thumbnails", + "show_details": "Show details with thumbnails", "show_favorite_control": "Show favorite control on thumbnails", "show_timeline_control": "Show timeline control on thumbnails", "size": "Thumbnails size in pixels" @@ -312,12 +312,12 @@ "delete": "Delete", "dimensions": "Dimensions", "dimensions_secondary": "Dimensions & shape options", - "event_gallery": "Event gallery", - "event_gallery_secondary": "Snapshots & clips gallery options", "image": "Image", "image_secondary": "Static image view options", "live": "Live", "live_secondary": "Live camera view options", + "media_gallery": "Media gallery", + "media_gallery_secondary": "Media gallery options", "media_viewer": "Media viewer", "media_viewer_secondary": "Viewer for static media (clips, snapshots or recordings)", "menu": "Menu", diff --git a/src/localize/languages/it.json b/src/localize/languages/it.json index f60c03a0..6c9db02e 100644 --- a/src/localize/languages/it.json +++ b/src/localize/languages/it.json @@ -122,7 +122,7 @@ "none": "Nessuna miniatura", "right": "Miniature in un cassetto a destra" }, - "show_details": "Mostra i dettagli dell'evento con le miniature", + "show_details": "", "show_favorite_control": "Mostra il controllo preferito sulle miniature", "show_timeline_control": "Mostra il controllo della sequenza temporale sulle miniature", "size": "Dimensione delle miniature in pixel" @@ -302,12 +302,12 @@ "delete": "Elimina", "dimensions": "Dimensioni", "dimensions_secondary": "Dimensioni e opzioni di forma", - "event_gallery": "Galleria degli eventi", - "event_gallery_secondary": "Opzioni della galleria di istantanee e clips", "image": "Immagine", "image_secondary": "Opzioni di visualizzazione dell'immagine statica", "live": "Live", "live_secondary": "Opzioni di visualizzazione della telecamera live", + "media_gallery": "", + "media_gallery_secondary": "", "media_viewer": "Visualizzatore dei media", "media_viewer_secondary": "Visualizzatore per supporti statici (clip, istantanee o registrazioni)", "menu": "Menu", diff --git a/src/localize/languages/pt-BR.json b/src/localize/languages/pt-BR.json index 841ca311..78ca48b3 100644 --- a/src/localize/languages/pt-BR.json +++ b/src/localize/languages/pt-BR.json @@ -122,7 +122,7 @@ "none": "Sem miniaturas", "right": "Miniaturas em uma gaveta à direita" }, - "show_details": "Mostrar detalhes do evento com miniaturas", + "show_details": "", "show_favorite_control": "Mostrar controle de favorito nas miniaturas", "show_timeline_control": "Mostrar controle da linha do tempo nas miniaturas", "size": "Tamanho das miniaturas em pixels" @@ -302,12 +302,12 @@ "delete": "Excluir", "dimensions": "Dimensões", "dimensions_secondary": "Dimensões e opções de forma", - "event_gallery": "Galeria de eventos", - "event_gallery_secondary": "Opções da galeria de Snapshots e clipes", "image": "Imagem", "image_secondary": "Opções de visualização de imagem estática", "live": "Ao vivo", "live_secondary": "Opções de visualização da câmera ao vivo", + "media_gallery": "", + "media_gallery_secondary": "", "media_viewer": "Visualizador de eventos", "media_viewer_secondary": "Opções do visualizador de Snapshots e clipes", "menu": "Menu", diff --git a/src/performance.ts b/src/performance.ts index 56f44758..7e929638 100644 --- a/src/performance.ts +++ b/src/performance.ts @@ -7,9 +7,9 @@ import { import { getArrayConfigPath, getConfigValue, setConfigValue } from './config-mgmt.js'; import { CONF_CAMERAS_ARRAY_TRIGGERS_OCCUPANCY, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL, - CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL, + CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL, CONF_LIVE_AUTO_MUTE, CONF_LIVE_CONTROLS_THUMBNAILS_MODE, CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_DETAILS, @@ -103,9 +103,9 @@ const LOW_PROFILE_DEFAULTS = { [`${CONF_MENU_BUTTONS_MEDIA_PLAYER}.enabled`]: false, // Disable all options in thumbnails. - [CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL]: false, - [CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL]: false, - [CONF_EVENT_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS]: false, + [CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL]: false, + [CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL]: false, + [CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS]: false, [CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL]: false, [CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL]: false, [CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_DETAILS]: false, diff --git a/src/types.ts b/src/types.ts index 453f64cb..a8564b47 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1251,8 +1251,8 @@ export const frigateCardConfigSchema = z.object({ view: viewConfigSchema, menu: menuConfigSchema, live: liveConfigSchema, + media_gallery: galleryConfigSchema, media_viewer: viewerConfigSchema, - event_gallery: galleryConfigSchema, image: imageConfigSchema, elements: pictureElementsSchema, dimensions: dimensionsConfigSchema, @@ -1279,8 +1279,8 @@ export const frigateCardConfigDefaults = { view: viewConfigDefault, menu: menuConfigDefault, live: liveConfigDefault, + media_gallery: galleryConfigDefault, media_viewer: viewerConfigDefault, - event_gallery: galleryConfigDefault, image: imageConfigDefault, timeline: timelineConfigDefault, performance: performanceConfigDefault,