Move rewatching in next up to display option and remove home section

This commit is contained in:
Bill Thornton 2022-03-01 00:56:48 -05:00
parent 3f0b8058ad
commit 86c458bf37
8 changed files with 39 additions and 39 deletions

View File

@ -757,13 +757,7 @@ class AppRouter {
}
if (item === 'nextup') {
url = '#!/list.html?type=nextup&serverId=' + options.serverId;
if (options.rewatching) {
url += '&rewatching=' + options.rewatching;
}
return url;
return '#!/list.html?type=nextup&serverId=' + options.serverId;
}
if (item === 'list') {

View File

@ -113,7 +113,6 @@ import template from './displaySettings.template.html';
context.querySelector('#chkBlurhash').checked = userSettings.enableBlurhash();
context.querySelector('#chkBackdrops').checked = userSettings.enableBackdrops();
context.querySelector('#chkDetailsBanner').checked = userSettings.detailsBanner();
context.querySelector('#chkUseEpisodeImagesInNextUp').checked = userSettings.useEpisodeImagesInNextUpAndResume();
context.querySelector('#chkDisableCustomCss').checked = userSettings.disableCustomCss();
context.querySelector('#txtLocalCustomCss').value = userSettings.customCss();
@ -122,7 +121,10 @@ import template from './displaySettings.template.html';
context.querySelector('.selectDateTimeLocale').value = userSettings.dateTimeLocale() || '';
context.querySelector('#txtLibraryPageSize').value = userSettings.libraryPageSize();
context.querySelector('#txtMaxDaysForNextUp').value = userSettings.maxDaysForNextUp();
context.querySelector('#chkRewatchingNextUp').checked = userSettings.enableRewatchingInNextUp();
context.querySelector('#chkUseEpisodeImagesInNextUp').checked = userSettings.useEpisodeImagesInNextUpAndResume();
context.querySelector('.selectLayout').value = layoutManager.getSavedLayout() || '';
@ -147,13 +149,15 @@ import template from './displaySettings.template.html';
userSettingsInstance.screensaver(context.querySelector('.selectScreensaver').value);
userSettingsInstance.libraryPageSize(context.querySelector('#txtLibraryPageSize').value);
userSettingsInstance.maxDaysForNextUp(context.querySelector('#txtMaxDaysForNextUp').value);
userSettingsInstance.enableRewatchingInNextUp(context.querySelector('#chkRewatchingNextUp').checked);
userSettingsInstance.useEpisodeImagesInNextUpAndResume(context.querySelector('#chkUseEpisodeImagesInNextUp').checked);
userSettingsInstance.enableFastFadein(context.querySelector('#chkFadein').checked);
userSettingsInstance.enableBlurhash(context.querySelector('#chkBlurhash').checked);
userSettingsInstance.enableBackdrops(context.querySelector('#chkBackdrops').checked);
userSettingsInstance.detailsBanner(context.querySelector('#chkDetailsBanner').checked);
userSettingsInstance.useEpisodeImagesInNextUpAndResume(context.querySelector('#chkUseEpisodeImagesInNextUp').checked);
userSettingsInstance.disableCustomCss(context.querySelector('#chkDisableCustomCss').checked);
userSettingsInstance.customCss(context.querySelector('#txtLocalCustomCss').value);

View File

@ -207,6 +207,14 @@
<div class="fieldDescription">${LabelMaxDaysForNextUpHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input type="checkbox" is="emby-checkbox" id="chkRewatchingNextUp" />
<span>${EnableRewatchingNextUp}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${EnableRewatchingNextUpHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input type="checkbox" is="emby-checkbox" id="chkFadein" />

View File

@ -27,7 +27,6 @@
<option value="resumebook">${HeaderContinueReading}</option>
<option value="latestmedia">${HeaderLatestMedia}</option>
<option value="nextup">${NextUp}</option>
<option value="rewatching">${NextUpRewatching}</option>
<option value="livetv">${LiveTV}</option>
<option value="none">${None}</option>
</select>
@ -42,7 +41,6 @@
<option value="resumebook">${HeaderContinueReading}</option>
<option value="latestmedia">${HeaderLatestMedia}</option>
<option value="nextup">${NextUp}</option>
<option value="rewatching">${NextUpRewatching}</option>
<option value="livetv">${LiveTV}</option>
<option value="none">${None}</option>
</select>
@ -57,7 +55,6 @@
<option value="resumebook">${HeaderContinueReading}</option>
<option value="latestmedia">${HeaderLatestMedia}</option>
<option value="nextup">${NextUp}</option>
<option value="rewatching">${NextUpRewatching}</option>
<option value="livetv">${LiveTV}</option>
<option value="none">${None}</option>
</select>
@ -72,7 +69,6 @@
<option value="resumebook">${HeaderContinueReading}</option>
<option value="latestmedia">${HeaderLatestMedia}</option>
<option value="nextup">${NextUp}</option>
<option value="rewatching">${NextUpRewatching}</option>
<option value="livetv">${LiveTV}</option>
<option value="none">${None}</option>
</select>
@ -87,7 +83,6 @@
<option value="resumebook">${HeaderContinueReading}</option>
<option value="latestmedia">${HeaderLatestMedia}</option>
<option value="nextup">${NextUp}</option>
<option value="rewatching">${NextUpRewatching}</option>
<option value="livetv">${LiveTV}</option>
<option value="none">${None}</option>
</select>
@ -102,7 +97,6 @@
<option value="resumebook">${HeaderContinueReading}</option>
<option value="latestmedia">${HeaderLatestMedia}</option>
<option value="nextup">${NextUp}</option>
<option value="rewatching">${NextUpRewatching}</option>
<option value="livetv">${LiveTV}</option>
<option value="none">${None}</option>
</select>
@ -117,7 +111,6 @@
<option value="resumebook">${HeaderContinueReading}</option>
<option value="latestmedia">${HeaderLatestMedia}</option>
<option value="nextup">${NextUp}</option>
<option value="rewatching">${NextUpRewatching}</option>
<option value="livetv">${LiveTV}</option>
<option value="none">${None}</option>
</select>

View File

@ -147,8 +147,6 @@ 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') {
@ -598,7 +596,7 @@ import ServerConnections from '../ServerConnections';
});
}
function getNextUpFetchFn(serverId, userSettings, rewatching) {
function getNextUpFetchFn(serverId, userSettings) {
return function () {
const apiClient = ServerConnections.getApiClient(serverId);
const oldestDateForNextUp = new Date();
@ -612,7 +610,7 @@ import ServerConnections from '../ServerConnections';
EnableTotalRecordCount: false,
DisableFirstEpisode: false,
NextUpDateCutoff: oldestDateForNextUp.toISOString(),
Rewatching: rewatching
EnableRewatching: userSettings.enableRewatchingInNextUp()
});
};
}
@ -638,31 +636,22 @@ import ServerConnections from '../ServerConnections';
};
}
function loadNextUp(elem, apiClient, userSettings, rewatching = false) {
function loadNextUp(elem, apiClient, userSettings) {
let html = '';
html += '<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">';
if (!layoutManager.tv) {
html += '<a is="emby-linkbutton" href="' + appRouter.getRouteUrl('nextup', {
serverId: apiClient.serverId(),
rewatching: rewatching
serverId: apiClient.serverId()
}) + '" class="button-flat button-flat-mini sectionTitleTextButton">';
html += '<h2 class="sectionTitle sectionTitle-cards">';
if (rewatching) {
html += globalize.translate('NextUpRewatching');
} else {
html += globalize.translate('NextUp');
}
html += globalize.translate('NextUp');
html += '</h2>';
html += '<span class="material-icons chevron_right" aria-hidden="true"></span>';
html += '</a>';
} else {
html += '<h2 class="sectionTitle sectionTitle-cards">';
if (rewatching) {
html += globalize.translate('NextUpRewatching');
} else {
html += globalize.translate('NextUp');
}
html += globalize.translate('NextUp');
html += '</h2>';
}
html += '</div>';
@ -683,7 +672,7 @@ import ServerConnections from '../ServerConnections';
elem.innerHTML = html;
const itemsContainer = elem.querySelector('.itemsContainer');
itemsContainer.fetchData = getNextUpFetchFn(apiClient.serverId(), userSettings, rewatching);
itemsContainer.fetchData = getNextUpFetchFn(apiClient.serverId(), userSettings);
itemsContainer.getItemsHtml = getNextUpItemsHtmlFn(userSettings.useEpisodeImagesInNextUpAndResume());
itemsContainer.parentContainer = elem;
}

View File

@ -260,7 +260,7 @@ import { appRouter } from '../components/appRouter';
EnableImageTypes: 'Primary,Backdrop,Thumb',
EnableTotalRecordCount: false,
SortBy: sortBy,
Rewatching: params.rewatching
EnableRewatching: userSettings.enableRewatchingInNextUp()
}));
}
@ -678,9 +678,6 @@ class ItemsView {
}
if (params.type === 'nextup') {
if (params.rewatching === 'true') {
return globalize.translate('NextUpRewatching');
}
return globalize.translate('NextUp');
}

View File

@ -461,6 +461,19 @@ export class UserSettings {
}
}
/**
* Get or set rewatching in next up.
* @param {boolean|undefined} val - If rewatching items should be included in next up.
* @returns {boolean} Rewatching in next up state.
*/
enableRewatchingInNextUp(val) {
if (val !== undefined) {
return this.set('enableRewatchingInNextUp', val, false);
}
return this.get('enableRewatchingInNextUp', false);
}
/**
* Get or set sound effects.
* @param {string|undefined} val - Sound effects.
@ -579,6 +592,7 @@ export const theme = currentSettings.theme.bind(currentSettings);
export const screensaver = currentSettings.screensaver.bind(currentSettings);
export const libraryPageSize = currentSettings.libraryPageSize.bind(currentSettings);
export const maxDaysForNextUp = currentSettings.maxDaysForNextUp.bind(currentSettings);
export const enableRewatchingInNextUp = currentSettings.enableRewatchingInNextUp.bind(currentSettings);
export const soundEffects = currentSettings.soundEffects.bind(currentSettings);
export const loadQuerySettings = currentSettings.loadQuerySettings.bind(currentSettings);
export const saveQuerySettings = currentSettings.saveQuerySettings.bind(currentSettings);

View File

@ -232,6 +232,8 @@
"EnableNextVideoInfoOverlayHelp": "At the end of a video, display info about the next video coming up in the current playlist.",
"EnablePhotos": "Display the photos",
"EnablePhotosHelp": "Images will be detected and displayed alongside other media files.",
"EnableRewatchingNextUp": "Enable Rewatching in Next Up",
"EnableRewatchingNextUpHelp": "Enable showing already watched episodes in 'Next Up' sections.",
"EnableQuickConnect": "Enable Quick Connect on this server",
"EnableStreamLooping": "Auto-loop live streams",
"EnableStreamLoopingHelp": "Enable this if live streams only contain a few seconds of data and need to be continuously requested. Enabling this when not needed may cause problems.",
@ -1131,7 +1133,6 @@
"NextChapter": "Next chapter",
"NextTrack": "Skip to next",
"NextUp": "Next Up",
"NextUpRewatching": "Rewatching",
"No": "No",
"NoCreatedLibraries": "Seems like you haven't created any libraries yet. {0}Would you like to create one now?{1}",
"None": "None",