|
|
@ -19486,7 +19486,11 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!lodash.isEmpty(this.libraryName.value)) {
|
|
|
|
if (!lodash.isEmpty(this.libraryName.value)) {
|
|
|
|
this.config.libraryName = this.libraryName.value;
|
|
|
|
this.config.libraryName = this.libraryName.value;
|
|
|
|
this.config.sort = `${this.sort.value}:${this.sortOrder.value}`;
|
|
|
|
let sortOrderValue = 'asc';
|
|
|
|
|
|
|
|
if (lodash.isEqual(this.sortOrder.value, 'Descending')) {
|
|
|
|
|
|
|
|
sortOrderValue = 'desc';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.config.sort = `${this.sort.value}:${sortOrderValue}`;
|
|
|
|
if (lodash.isEmpty(this.maxCount.value)) {
|
|
|
|
if (lodash.isEmpty(this.maxCount.value)) {
|
|
|
|
this.config.maxCount = '';
|
|
|
|
this.config.maxCount = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -19649,23 +19653,26 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
|
|
|
|
this.plexValidSection.appendChild(this.sort);
|
|
|
|
this.plexValidSection.appendChild(this.sort);
|
|
|
|
this.sortOrder.innerHTML = '';
|
|
|
|
this.sortOrder.innerHTML = '';
|
|
|
|
const sortOrderItems = document.createElement('paper-listbox');
|
|
|
|
const sortOrderItems = document.createElement('paper-listbox');
|
|
|
|
sortOrderItems.appendChild(addDropdownItem('asc'));
|
|
|
|
sortOrderItems.appendChild(addDropdownItem('Ascending'));
|
|
|
|
sortOrderItems.appendChild(addDropdownItem('desc'));
|
|
|
|
sortOrderItems.appendChild(addDropdownItem('Descending'));
|
|
|
|
sortOrderItems.slot = 'dropdown-content';
|
|
|
|
sortOrderItems.slot = 'dropdown-content';
|
|
|
|
this.sortOrder.label = 'Sort Order';
|
|
|
|
this.sortOrder.label = 'Sort Order';
|
|
|
|
this.sortOrder.appendChild(sortOrderItems);
|
|
|
|
this.sortOrder.appendChild(sortOrderItems);
|
|
|
|
this.sortOrder.style.width = '100%';
|
|
|
|
this.sortOrder.style.width = '100%';
|
|
|
|
this.sortOrder.addEventListener('value-changed', this.valueUpdated);
|
|
|
|
this.sortOrder.addEventListener('value-changed', this.valueUpdated);
|
|
|
|
if (lodash.isEmpty(this.config.sort)) {
|
|
|
|
if (lodash.isEmpty(this.config.sort)) {
|
|
|
|
this.sortOrder.value = 'asc';
|
|
|
|
this.sortOrder.value = 'Ascending';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
const sortOrder = this.config.sort.split(':')[1];
|
|
|
|
const sortOrder = this.config.sort.split(':')[1];
|
|
|
|
if (lodash.isEmpty(sortOrder)) {
|
|
|
|
if (lodash.isEmpty(sortOrder)) {
|
|
|
|
this.sortOrder.value = 'asc';
|
|
|
|
this.sortOrder.value = 'Ascending';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else if (lodash.isEqual(sortOrder, 'asc')) {
|
|
|
|
this.sortOrder.value = sortOrder;
|
|
|
|
this.sortOrder.value = 'Ascending';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (lodash.isEqual(sortOrder, 'desc')) {
|
|
|
|
|
|
|
|
this.sortOrder.value = 'Descending';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.plexValidSection.appendChild(this.sortOrder);
|
|
|
|
this.plexValidSection.appendChild(this.sortOrder);
|
|
|
|