Fix: Bug where if searched used and one poster returned it was no longer possible to get more than 1 poster on page

pull/30/head 2.0.11
Juraj Nyíri 3 years ago
parent 1b3d3f8572
commit c29c377c92

@ -21088,10 +21088,12 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.searchInputElem.value = this.searchValue; this.searchInputElem.value = this.searchValue;
this.searchInputElem.placeholder = `Search ${this.config.libraryName}...`; this.searchInputElem.placeholder = `Search ${this.config.libraryName}...`;
this.searchInputElem.addEventListener('keyup', () => { this.searchInputElem.addEventListener('keyup', () => {
this.searchValue = this.searchInputElem.value; if (!lodash.isEqual(this.searchInputElem.value, this.searchValue)) {
this.renderPage(); this.searchValue = this.searchInputElem.value;
this.focus(); this.renderPage();
this.renderNewElementsIfNeeded(); this.focus();
this.renderNewElementsIfNeeded();
}
}); });
searchContainer.appendChild(this.searchInputElem); searchContainer.appendChild(this.searchInputElem);
return searchContainer; return searchContainer;
@ -21182,7 +21184,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
} }
} }
this.renderedItems = 0; this.renderedItems = 0;
this.columnsCount = 0; // this.columnsCount = 0;
const spinner = document.createElement('div'); const spinner = document.createElement('div');
spinner.style.display = 'flex'; spinner.style.display = 'flex';
spinner.style.alignItems = 'center'; spinner.style.alignItems = 'center';

@ -154,7 +154,6 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.renderedItems > 0 this.renderedItems > 0
) { ) {
this.maxRenderCount = this.renderedItems + this.columnsCount * (loadAdditionalRowsCount * 2); this.maxRenderCount = this.renderedItems + this.columnsCount * (loadAdditionalRowsCount * 2);
this.renderMovieElems(); this.renderMovieElems();
this.calculatePositions(); this.calculatePositions();
} }
@ -452,10 +451,12 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.searchInputElem.placeholder = `Search ${this.config.libraryName}...`; this.searchInputElem.placeholder = `Search ${this.config.libraryName}...`;
this.searchInputElem.addEventListener('keyup', () => { this.searchInputElem.addEventListener('keyup', () => {
this.searchValue = this.searchInputElem.value; if (!_.isEqual(this.searchInputElem.value, this.searchValue)) {
this.renderPage(); this.searchValue = this.searchInputElem.value;
this.focus(); this.renderPage();
this.renderNewElementsIfNeeded(); this.focus();
this.renderNewElementsIfNeeded();
}
}); });
searchContainer.appendChild(this.searchInputElem); searchContainer.appendChild(this.searchInputElem);
@ -557,7 +558,8 @@ class PlexMeetsHomeAssistant extends HTMLElement {
} }
this.renderedItems = 0; this.renderedItems = 0;
this.columnsCount = 0; // this.columnsCount = 0;
const spinner = document.createElement('div'); const spinner = document.createElement('div');
spinner.style.display = 'flex'; spinner.style.display = 'flex';
spinner.style.alignItems = 'center'; spinner.style.alignItems = 'center';

Loading…
Cancel
Save