From 47a0637b14641a25b3fcc9aa648980b84659a31e Mon Sep 17 00:00:00 2001 From: Johan Frick Date: Wed, 7 Feb 2024 22:03:08 +0100 Subject: [PATCH] feature: default to icons for favorites list (and show titles) --- src/card.ts | 1 + src/components/media-browser-icons.ts | 2 +- src/editor/advanced-editor.ts | 2 +- src/editor/general-editor.ts | 2 +- src/sections/media-browser.ts | 2 +- src/types.ts | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/card.ts b/src/card.ts index a5ecf0b7..90a6e760 100644 --- a/src/card.ts +++ b/src/card.ts @@ -212,6 +212,7 @@ export class Card extends LitElement { } else { this.section = PLAYER; } + newConfig.mediaBrowserItemsPerRow = newConfig.mediaBrowserItemsPerRow || 4; this.config = newConfig; } diff --git a/src/components/media-browser-icons.ts b/src/components/media-browser-icons.ts index bb5ced76..e025af1c 100755 --- a/src/components/media-browser-icons.ts +++ b/src/components/media-browser-icons.ts @@ -32,7 +32,7 @@ export class MediaBrowserIcons extends LitElement { class="button" @click=${() => this.dispatchEvent(customEvent(MEDIA_ITEM_SELECTED, item))} > - ${renderMediaBrowserItem(item, !item.thumbnail || !!this.config.mediaBrowserShowTitleForThumbnailIcons)} + ${renderMediaBrowserItem(item, !item.thumbnail || !this.config.mediaBrowserHideTitleForThumbnailIcons)} `, )} diff --git a/src/editor/advanced-editor.ts b/src/editor/advanced-editor.ts index cceaab4c..d0e24c75 100644 --- a/src/editor/advanced-editor.ts +++ b/src/editor/advanced-editor.ts @@ -28,7 +28,7 @@ export const ADVANCED_SCHEMA = [ name: 'artworkHostname', }, { - name: 'mediaBrowserShowTitleForThumbnailIcons', + name: 'mediaBrowserHideTitleForThumbnailIcons', selector: { boolean: {} }, }, { diff --git a/src/editor/general-editor.ts b/src/editor/general-editor.ts index e05e63bb..a122d3e6 100644 --- a/src/editor/general-editor.ts +++ b/src/editor/general-editor.ts @@ -16,7 +16,7 @@ export const GENERAL_SCHEMA = [ { type: 'integer', name: 'mediaBrowserItemsPerRow', - default: 1, + default: 4, required: true, valueMin: 1, valueMax: 30, diff --git a/src/sections/media-browser.ts b/src/sections/media-browser.ts index 7e46dc51..4e17d447 100755 --- a/src/sections/media-browser.ts +++ b/src/sections/media-browser.ts @@ -33,7 +33,7 @@ export class MediaBrowser extends LitElement { until( this.getFavorites(this.activePlayer).then((items) => { if (items?.length) { - return (this.config.mediaBrowserItemsPerRow ?? 0) > 1 + return (this.config.mediaBrowserItemsPerRow ?? 4) > 1 ? html`