From 78b32f0549059f9a198a35ab537aa360124eeaa4 Mon Sep 17 00:00:00 2001 From: Johan Frick Date: Wed, 27 Sep 2023 19:17:47 +0200 Subject: [PATCH] feature: top favorites --- README.md | 4 ++++ src/editor/advanced-editor.ts | 17 ++++++++++++++++- src/sections/media-browser.ts | 15 ++++++++++++++- src/types.ts | 1 + 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b83e102..86be59e8 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,10 @@ customThumbnailIfMissing: mediaBrowserTitlesToIgnore: - Local Media - My Bad Playlist +topFavorites: # Show these favorites at the top of the list + - Legendary + - Country Rocks + - Kacey Musgraves Radio ``` ## Using individual section cards diff --git a/src/editor/advanced-editor.ts b/src/editor/advanced-editor.ts index 306d9f66..13657c26 100644 --- a/src/editor/advanced-editor.ts +++ b/src/editor/advanced-editor.ts @@ -27,12 +27,18 @@ export const ADVANCED_SCHEMA = [ name: 'mediaBrowserShowTitleForThumbnailIcons', selector: { boolean: {} }, }, + { + type: 'string', + name: 'topFavorites', + }, ]; class AdvancedEditor extends BaseEditor { protected render(): TemplateResult { + const topFavorites = this.store.config.topFavorites ?? []; + const data = { ...this.store.config, topFavorites: topFavorites.join(', ') }; return html` - +

The following needs to be configured using code (YAML):