diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index bbc51b4..94b5f52 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -21089,10 +21089,10 @@ class PlexMeetsHomeAssistant extends HTMLElement { if (areaSize > 0) { CSS_STYLE.width = areaSize / postersInRow - marginRight; CSS_STYLE.height = CSS_STYLE.width * CSS_STYLE.ratio; + const episodesInRow = Math.floor(areaSize / CSS_STYLE.minimumEpisodeWidth); + CSS_STYLE.episodeWidth = Math.floor(areaSize / episodesInRow - marginRight); + CSS_STYLE.episodeHeight = Math.round(CSS_STYLE.episodeWidth * CSS_STYLE.episodeRatio); } - const episodesInRow = Math.floor(areaSize / CSS_STYLE.minimumEpisodeWidth); - CSS_STYLE.episodeWidth = Math.floor(areaSize / episodesInRow - marginRight); - CSS_STYLE.episodeHeight = Math.round(CSS_STYLE.episodeWidth * CSS_STYLE.episodeRatio); } this.renderedItems = 0; this.columnsCount = 0; diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 2c21370..135aa01 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -497,12 +497,11 @@ class PlexMeetsHomeAssistant extends HTMLElement { if (areaSize > 0) { CSS_STYLE.width = areaSize / postersInRow - marginRight; CSS_STYLE.height = CSS_STYLE.width * CSS_STYLE.ratio; - } - - const episodesInRow = Math.floor(areaSize / CSS_STYLE.minimumEpisodeWidth); + const episodesInRow = Math.floor(areaSize / CSS_STYLE.minimumEpisodeWidth); - CSS_STYLE.episodeWidth = Math.floor(areaSize / episodesInRow - marginRight); - CSS_STYLE.episodeHeight = Math.round(CSS_STYLE.episodeWidth * CSS_STYLE.episodeRatio); + CSS_STYLE.episodeWidth = Math.floor(areaSize / episodesInRow - marginRight); + CSS_STYLE.episodeHeight = Math.round(CSS_STYLE.episodeWidth * CSS_STYLE.episodeRatio); + } } this.renderedItems = 0;