diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 14033b6..ff6d18a 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -22042,14 +22042,11 @@ class PlexMeetsHomeAssistant extends HTMLElement { CSS_STYLE.episodeHeight = Math.round(CSS_STYLE.episodeWidth * CSS_STYLE.episodeRatio); } else if (this.renderPageRetries < 10) { - { - // sometimes it loop forever, todo: properly fix! - setTimeout(() => { - this.renderPageRetries += 1; - console.log('retry'); - this.renderPage(); - }, 250); - } + // sometimes it loop forever, todo: properly fix! + setTimeout(() => { + this.renderPageRetries += 1; + this.renderPage(); + }, 250); } } this.renderedItems = 0; @@ -22372,15 +22369,16 @@ class PlexMeetsHomeAssistant extends HTMLElement { } }; this.minimizeAll = () => { - // this.content.style.position = 'relative'; this.detailsShown = false; if (this.activeMovieElem) { this.activeMovieElem.style.display = `block`; } this.activeMovieElem = undefined; for (let i = 0; i < this.movieElems.length; i += 1) { - if (lodash.isEqual(parseInt(this.movieElems[i].style.width, 10), this.minExpandedWidth) && - lodash.isEqual(parseInt(this.movieElems[i].style.height, 10), this.minExpandedHeight)) { + if ((lodash.isEqual(parseInt(this.movieElems[i].style.width, 10), this.minExpandedWidth) && + lodash.isEqual(parseInt(this.movieElems[i].style.height, 10), this.minExpandedHeight)) || + (lodash.isEqual(parseInt(this.movieElems[i].style.width, 10), this.minExpandedWidth) && + lodash.isEqual(parseInt(this.movieElems[i].style.height, 10), this.minExpandedWidth))) { if (lodash.isEqual(this.movieElems[i].style.width, this.movieElems[i].style.height)) { this.movieElems[i].style.width = `${CSS_STYLE.width}px`; this.movieElems[i].style.height = `${CSS_STYLE.width}px`; @@ -23075,7 +23073,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { container.style.marginBottom = '5px'; } if (!lodash.isNil(data.channelCallSign)) { - container.style.marginBottom = '50px'; + container.style.marginBottom = '10px'; } const movieElem = document.createElement('div'); movieElem.className = 'movieElem'; @@ -23085,7 +23083,6 @@ class PlexMeetsHomeAssistant extends HTMLElement { movieElem.style.backgroundSize = '80%'; movieElem.style.backgroundColor = 'rgba(0,0,0,0.2)'; movieElem.style.backgroundPosition = 'center'; - container.style.height = container.style.width; movieElem.style.height = `${CSS_STYLE.width}px`; } movieElem.style.backgroundImage = `url('${thumbURL}')`; @@ -23167,6 +23164,9 @@ class PlexMeetsHomeAssistant extends HTMLElement { else if (!lodash.isNil(data.epg)) { yearElem.innerHTML = escapeHtml(data.epg.title); } + else { + yearElem.innerHTML = ' '; + } yearElem.className = 'yearElem'; yearElem.style.fontSize = `${this.fontSize2}px`; yearElem.style.lineHeight = `${this.fontSize2}px`; diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index bf440f3..987081c 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -1023,7 +1023,6 @@ class PlexMeetsHomeAssistant extends HTMLElement { }; minimizeAll = (): void => { - // this.content.style.position = 'relative'; this.detailsShown = false; if (this.activeMovieElem) { this.activeMovieElem.style.display = `block`; @@ -1032,8 +1031,10 @@ class PlexMeetsHomeAssistant extends HTMLElement { this.activeMovieElem = undefined; for (let i = 0; i < this.movieElems.length; i += 1) { if ( - _.isEqual(parseInt(this.movieElems[i].style.width, 10), this.minExpandedWidth) && - _.isEqual(parseInt(this.movieElems[i].style.height, 10), this.minExpandedHeight) + (_.isEqual(parseInt(this.movieElems[i].style.width, 10), this.minExpandedWidth) && + _.isEqual(parseInt(this.movieElems[i].style.height, 10), this.minExpandedHeight)) || + (_.isEqual(parseInt(this.movieElems[i].style.width, 10), this.minExpandedWidth) && + _.isEqual(parseInt(this.movieElems[i].style.height, 10), this.minExpandedWidth)) ) { if (_.isEqual(this.movieElems[i].style.width, this.movieElems[i].style.height)) { this.movieElems[i].style.width = `${CSS_STYLE.width}px`; @@ -1804,7 +1805,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { container.style.marginBottom = '5px'; } if (!_.isNil(data.channelCallSign)) { - container.style.marginBottom = '50px'; + container.style.marginBottom = '10px'; } const movieElem = document.createElement('div'); @@ -1817,7 +1818,6 @@ class PlexMeetsHomeAssistant extends HTMLElement { movieElem.style.backgroundSize = '80%'; movieElem.style.backgroundColor = 'rgba(0,0,0,0.2)'; movieElem.style.backgroundPosition = 'center'; - container.style.height = container.style.width; movieElem.style.height = `${CSS_STYLE.width}px`; } @@ -1910,6 +1910,8 @@ class PlexMeetsHomeAssistant extends HTMLElement { yearElem.innerHTML = escapeHtml(data.year); } else if (!_.isNil(data.epg)) { yearElem.innerHTML = escapeHtml(data.epg.title); + } else { + yearElem.innerHTML = ' '; } yearElem.className = 'yearElem'; yearElem.style.fontSize = `${this.fontSize2}px`;