Move rewatching to separate home screen section

This commit is contained in:
Bill Thornton 2022-02-22 15:24:03 -05:00
parent 418b2d35d7
commit c43f2ddfdd
2 changed files with 10 additions and 16 deletions

View file

@ -147,6 +147,8 @@ import ServerConnections from '../ServerConnections';
loadLatestLiveTvRecordings(elem, true, apiClient);
} else if (section === 'nextup') {
loadNextUp(elem, apiClient, userSettings);
} else if (section === 'rewatching') {
loadNextUp(elem, apiClient, userSettings, true);
} else if (section === 'onnow' || section === 'livetv') {
return loadOnNow(elem, apiClient, user);
} else if (section === 'resumebook') {
@ -636,7 +638,7 @@ import ServerConnections from '../ServerConnections';
};
}
function renderNextUpSection(elem, apiClient, userSettings, rewatching) {
function loadNextUp(elem, apiClient, userSettings, rewatching = false) {
let html = '';
html += '<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">';
@ -686,21 +688,6 @@ import ServerConnections from '../ServerConnections';
itemsContainer.parentContainer = elem;
}
function loadNextUp(elem, apiClient, userSettings) {
elem.classList.remove('verticalSection');
for (let i = 0; i <= 1; i++) {
const frag = document.createElement('div');
frag.classList.add('verticalSection');
frag.classList.add('hide');
elem.appendChild(frag);
// 0 pass is regular next up
// 1 pass is rewatching next up
renderNextUpSection(frag, apiClient, userSettings, i == 1);
}
}
function getLatestRecordingsFetchFn(serverId, activeRecordingsOnly) {
return function () {
const apiClient = ServerConnections.getApiClient(serverId);