Skip to content

Commit

Permalink
Fix for bug when only 1 poster showing
Browse files Browse the repository at this point in the history
  • Loading branch information
petersem committed Sep 21, 2023
1 parent ee97e38 commit c51c1ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ async function loadNowScreening() {
// Concatenate cards for all objects load now showing and on-demand cards, else just on-demand (if present)
// TODO - move this into its own function!
let mCards = [];
// id now screening false, then clear array
// is now screening false, then clear array
if (!isNowShowingEnabled) { nsCards.length = 0 };

if (nsCards.length > 0) {
Expand Down Expand Up @@ -505,6 +505,8 @@ async function loadNowScreening() {
theaterOff(true);
}

// clear nscards if nothing playing
// mCards = [];

pinnedMode = false;
if (odCards.length > 0) {
Expand Down Expand Up @@ -579,6 +581,7 @@ async function loadNowScreening() {
}
}
}
// globalPage.cards = mCards;
}

// setup transition - fade or default slide
Expand Down
4 changes: 1 addition & 3 deletions myviews/posters/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
Missing necessary settings. Click <a href="<%=baseUrl%>/settings" class="alert-link">here</a> to setup.
</div>
<% } %>

<%
<% }
let noLinks='false';
if(globals.hideSettingsLinks !== undefined && globals.hideSettingsLinks == 'true'){
noLinks = globals.hideSettingsLinks;
Expand Down
4 changes: 3 additions & 1 deletion myviews/posters/posters.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
xhr.onload = () => {
// get JSON response
// console.log('got response');
const posterr = xhr.response;
if((!posterr == null || posterr.globalPage.cards.length !== 0) && sleeping !== "true") {
let cardHtml = "";
Expand All @@ -154,6 +153,9 @@
setTimeout( getCards, posterr.globalPage.slideDuration );
}
}
else {
location.reload();
}
}
}
Expand Down

0 comments on commit c51c1ba

Please sign in to comment.