|
|
@ -19621,7 +19621,11 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
|
|
|
|
this.content.appendChild(plexTitle);
|
|
|
|
this.content.appendChild(plexTitle);
|
|
|
|
this.protocol.innerHTML = '';
|
|
|
|
this.protocol.innerHTML = '';
|
|
|
|
const protocolItems = document.createElement('paper-listbox');
|
|
|
|
const protocolItems = document.createElement('paper-listbox');
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-restricted-globals
|
|
|
|
|
|
|
|
const pageProtocol = location.protocol;
|
|
|
|
|
|
|
|
if (lodash.isEqual(pageProtocol, 'http:')) {
|
|
|
|
protocolItems.appendChild(addDropdownItem('http'));
|
|
|
|
protocolItems.appendChild(addDropdownItem('http'));
|
|
|
|
|
|
|
|
}
|
|
|
|
protocolItems.appendChild(addDropdownItem('https'));
|
|
|
|
protocolItems.appendChild(addDropdownItem('https'));
|
|
|
|
protocolItems.slot = 'dropdown-content';
|
|
|
|
protocolItems.slot = 'dropdown-content';
|
|
|
|
this.protocol.label = 'Plex Protocol';
|
|
|
|
this.protocol.label = 'Plex Protocol';
|
|
|
@ -19629,8 +19633,13 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
|
|
|
|
this.protocol.style.width = '100%';
|
|
|
|
this.protocol.style.width = '100%';
|
|
|
|
this.protocol.addEventListener('value-changed', this.valueUpdated);
|
|
|
|
this.protocol.addEventListener('value-changed', this.valueUpdated);
|
|
|
|
if (lodash.isEmpty(this.config.protocol)) {
|
|
|
|
if (lodash.isEmpty(this.config.protocol)) {
|
|
|
|
|
|
|
|
if (lodash.isEqual(pageProtocol, 'http:')) {
|
|
|
|
this.protocol.value = 'http';
|
|
|
|
this.protocol.value = 'http';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
this.protocol.value = 'https';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
this.protocol.value = this.config.protocol;
|
|
|
|
this.protocol.value = this.config.protocol;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -19945,12 +19954,17 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
this.plexPort = false;
|
|
|
|
this.plexPort = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-restricted-globals
|
|
|
|
|
|
|
|
const pageProtocol = location.protocol;
|
|
|
|
if (config.protocol) {
|
|
|
|
if (config.protocol) {
|
|
|
|
this.plexProtocol = config.protocol;
|
|
|
|
this.plexProtocol = config.protocol;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else if (lodash.isEqual(pageProtocol, 'http:')) {
|
|
|
|
this.config.protocol = 'http';
|
|
|
|
this.config.protocol = 'http';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
this.config.protocol = 'https';
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!config.sort) {
|
|
|
|
if (!config.sort) {
|
|
|
|
this.config.sort = 'titleSort:asc';
|
|
|
|
this.config.sort = 'titleSort:asc';
|
|
|
|
}
|
|
|
|
}
|
|
|
|