1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add setting for max days for a show to appear in next up list

This commit is contained in:
Jack 2021-06-22 22:05:51 -04:00
parent 2fe6a63542
commit e0a6ad943f
5 changed files with 35 additions and 3 deletions

View file

@ -429,6 +429,25 @@ export class UserSettings {
}
}
/**
* Get or set max days for next up list.
* @param {number|undefined} val - Max days for next up.
* @return {number} Max days for a show to stay in next up without being watched.
*/
maxDaysForNextUp(val) {
if (val !== undefined) {
return this.set('maxDaysForNextUp', parseInt(val, 10), false);
}
const maxDaysForNextUp = parseInt(this.get('maxDaysForNextUp', false), 10);
if (maxDaysForNextUp === 0) {
// Explicitly return 0 to avoid returning 100 because 0 is falsy.
return 0;
} else {
return maxDaysForNextUp || 100;
}
}
/**
* Get or set sound effects.
* @param {string|undefined} val - Sound effects.
@ -545,6 +564,7 @@ export const skin = currentSettings.skin.bind(currentSettings);
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 soundEffects = currentSettings.soundEffects.bind(currentSettings);
export const loadQuerySettings = currentSettings.loadQuerySettings.bind(currentSettings);
export const saveQuerySettings = currentSettings.saveQuerySettings.bind(currentSettings);