Update: Episodes span the whole width

pull/16/head 1.2
Juraj Nyíri 3 years ago
parent 078e3dcfc9
commit e164c080da

@ -17200,8 +17200,8 @@ const CSS_STYLE = {
minimumWidth: 138, minimumWidth: 138,
expandedWidth: 220, expandedWidth: 220,
expandedHeight: 324, expandedHeight: 324,
episodeWidth: 300, episodeRatio: 0.563,
episodeHeight: 169 minimumEpisodeWidth: 300
}; };
const supported = { const supported = {
kodi: ['movie', 'episode'], kodi: ['movie', 'episode'],
@ -19550,7 +19550,7 @@ style.textContent = css `
z-index: 5; z-index: 5;
position: absolute; position: absolute;
top: ${CSS_STYLE.expandedHeight + 16}px; top: ${CSS_STYLE.expandedHeight + 16}px;
width: calc(100% - 32px); width: calc(100% - 22px);
left: 0; left: 0;
padding: 16px; padding: 16px;
display: none; display: none;
@ -19847,7 +19847,7 @@ style.textContent = css `
.episodeContainer { .episodeContainer {
position: relative; position: relative;
float: left; float: left;
margin-right: 16px; margin-right: 10px;
margin-bottom: 15px; margin-bottom: 15px;
transition: 0.5s; transition: 0.5s;
} }
@ -20270,6 +20270,9 @@ class PlexMeetsHomeAssistant extends HTMLElement {
const postersInRow = Math.floor(areaSize / CSS_STYLE.minimumWidth); const postersInRow = Math.floor(areaSize / CSS_STYLE.minimumWidth);
CSS_STYLE.width = areaSize / postersInRow - marginRight; CSS_STYLE.width = areaSize / postersInRow - marginRight;
CSS_STYLE.height = CSS_STYLE.width * CSS_STYLE.ratio; 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);
} }
this.renderedItems = 0; this.renderedItems = 0;
this.columnsCount = 0; this.columnsCount = 0;

@ -4,8 +4,8 @@ const CSS_STYLE: any = {
minimumWidth: 138, minimumWidth: 138,
expandedWidth: 220, expandedWidth: 220,
expandedHeight: 324, expandedHeight: 324,
episodeWidth: 300, episodeRatio: 0.563,
episodeHeight: 169 minimumEpisodeWidth: 300
}; };
const supported: any = { const supported: any = {

@ -35,7 +35,7 @@ style.textContent = css`
z-index: 5; z-index: 5;
position: absolute; position: absolute;
top: ${CSS_STYLE.expandedHeight + 16}px; top: ${CSS_STYLE.expandedHeight + 16}px;
width: calc(100% - 32px); width: calc(100% - 22px);
left: 0; left: 0;
padding: 16px; padding: 16px;
display: none; display: none;
@ -332,7 +332,7 @@ style.textContent = css`
.episodeContainer { .episodeContainer {
position: relative; position: relative;
float: left; float: left;
margin-right: 16px; margin-right: 10px;
margin-bottom: 15px; margin-bottom: 15px;
transition: 0.5s; transition: 0.5s;
} }

@ -400,6 +400,11 @@ class PlexMeetsHomeAssistant extends HTMLElement {
const postersInRow = Math.floor(areaSize / CSS_STYLE.minimumWidth); const postersInRow = Math.floor(areaSize / CSS_STYLE.minimumWidth);
CSS_STYLE.width = areaSize / postersInRow - marginRight; CSS_STYLE.width = areaSize / postersInRow - marginRight;
CSS_STYLE.height = CSS_STYLE.width * CSS_STYLE.ratio; 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);
} }
this.renderedItems = 0; this.renderedItems = 0;

Loading…
Cancel
Save