From b556ea2b8c09bc9d40fc01ab4eb620c68c618622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Fri, 17 Sep 2021 17:18:53 +0200 Subject: [PATCH] Fix #41: Display spaces in library options --- dist/plex-meets-homeassistant.js | 4 +++- src/editor.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index bd9c4b6..75f939c 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -19881,6 +19881,8 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { if (!this.config.entity) { this.config.entity = []; } + console.log(this.libraryName); + console.log(this.libraryName.value); if (!lodash.isEmpty(this.libraryName.value)) { this.config.libraryName = this.libraryName.value; let sortOrderValue = ''; @@ -19954,7 +19956,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { this.render = async () => { const addDropdownItem = (text, disabled = false) => { const libraryItem = document.createElement('paper-item'); - libraryItem.innerHTML = text; + libraryItem.innerHTML = text.replace(/ /g, ' '); if (disabled) { libraryItem.disabled = true; } diff --git a/src/editor.ts b/src/editor.ts index 15a80a1..66bb277 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -102,6 +102,8 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { if (!this.config.entity) { this.config.entity = []; } + console.log(this.libraryName); + console.log(this.libraryName.value); if (!_.isEmpty(this.libraryName.value)) { this.config.libraryName = this.libraryName.value; @@ -172,7 +174,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { render = async (): Promise => { const addDropdownItem = (text: string, disabled = false): HTMLElement => { const libraryItem: any = document.createElement('paper-item'); - libraryItem.innerHTML = text; + libraryItem.innerHTML = text.replace(/ /g, ' '); if (disabled) { libraryItem.disabled = true; } @@ -311,6 +313,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { this.plexProtocol, this.config.sort ); + this.sections = await this.plex.getSections(); this.livetv = await this.plex.getLiveTV(); this.collections = await this.plex.getCollections();