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

Merge pull request #2753 from jackrvan/master

Add setting for max days for a show to appear in next up list
This commit is contained in:
Bill Thornton 2021-09-17 15:11:31 -04:00 committed by GitHub
commit 27b26f7671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 3 deletions

View file

@ -442,6 +442,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 || 365;
}
}
/**
* Get or set sound effects.
* @param {string|undefined} val - Sound effects.
@ -559,6 +578,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);