Add: Warning about live TV play action not supported by Plex

live_tv
Juraj Nyíri 3 years ago
parent 0a5705c61a
commit f34051c44e

@ -19893,7 +19893,10 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
this.libraryName.appendChild(libraryItems);
this.libraryName.style.width = '100%';
this.libraryName.addEventListener('value-changed', this.valueUpdated);
const warningLibrary = document.createElement('div');
warningLibrary.style.color = 'red';
this.content.appendChild(this.libraryName);
this.content.appendChild(warningLibrary);
this.appendChild(this.content);
this.plex = new Plex(this.config.ip, this.plexPort, this.config.token, this.plexProtocol, this.config.sort);
this.sections = await this.plex.getSections();
@ -20110,6 +20113,9 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
if (!lodash.isEmpty(this.livetv)) {
libraryItems.appendChild(addDropdownItem('Live TV', true));
lodash.forEach(lodash.keys(this.livetv), (livetv) => {
if (lodash.isEqual(this.config.libraryName, livetv)) {
warningLibrary.textContent = `Warning: ${this.config.libraryName} play action currently not supported by Plex.`;
}
libraryItems.appendChild(addDropdownItem(livetv));
});
}

@ -296,7 +296,11 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
this.libraryName.appendChild(libraryItems);
this.libraryName.style.width = '100%';
this.libraryName.addEventListener('value-changed', this.valueUpdated);
const warningLibrary = document.createElement('div');
warningLibrary.style.color = 'red';
this.content.appendChild(this.libraryName);
this.content.appendChild(warningLibrary);
this.appendChild(this.content);
@ -525,6 +529,9 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
if (!_.isEmpty(this.livetv)) {
libraryItems.appendChild(addDropdownItem('Live TV', true));
_.forEach(_.keys(this.livetv), (livetv: string) => {
if (_.isEqual(this.config.libraryName, livetv)) {
warningLibrary.textContent = `Warning: ${this.config.libraryName} play action currently not supported by Plex.`;
}
libraryItems.appendChild(addDropdownItem(livetv));
});
}

Loading…
Cancel
Save