Fix: Elements not rendered if search cleaned

pull/16/head
Juraj Nyíri 3 years ago
parent ebe419d60f
commit d78583a1d5

@ -19948,6 +19948,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.searchValue = searchInput.value; this.searchValue = searchInput.value;
this.renderPage(); this.renderPage();
this.focus(); this.focus();
this.renderNewElementsIfNeeded();
}); });
searchContainer.appendChild(searchInput); searchContainer.appendChild(searchInput);
return searchContainer; return searchContainer;
@ -20434,6 +20435,8 @@ class PlexMeetsHomeAssistant extends HTMLElement {
seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]); seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]);
} }
const dataDetails = await this.plex.getDetails(data.key.split('/')[3]); const dataDetails = await this.plex.getDetails(data.key.split('/')[3]);
console.log(dataDetails);
console.log(dataDetails.Extras);
if (this.videoElem) { if (this.videoElem) {
const trailerURL = findTrailerURL(dataDetails); const trailerURL = findTrailerURL(dataDetails);
if (trailerURL !== '') { if (trailerURL !== '') {

@ -227,6 +227,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.searchValue = searchInput.value; this.searchValue = searchInput.value;
this.renderPage(); this.renderPage();
this.focus(); this.focus();
this.renderNewElementsIfNeeded();
}); });
searchContainer.appendChild(searchInput); searchContainer.appendChild(searchInput);
@ -752,6 +753,8 @@ class PlexMeetsHomeAssistant extends HTMLElement {
seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]); seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]);
} }
const dataDetails = await this.plex.getDetails(data.key.split('/')[3]); const dataDetails = await this.plex.getDetails(data.key.split('/')[3]);
console.log(dataDetails);
console.log(dataDetails.Extras);
if (this.videoElem) { if (this.videoElem) {
const trailerURL = findTrailerURL(dataDetails); const trailerURL = findTrailerURL(dataDetails);
if (trailerURL !== '') { if (trailerURL !== '') {

Loading…
Cancel
Save