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

Make 'ask to skip' the default for intro and outro segments

This commit is contained in:
viown 2024-10-28 17:12:07 +03:00
parent d4d84d0a18
commit 37be617523
2 changed files with 7 additions and 3 deletions

View file

@ -8,7 +8,11 @@ const PREFIX = 'segmentTypeAction';
export const getId = (type: MediaSegmentType) => `${PREFIX}__${type}`; export const getId = (type: MediaSegmentType) => `${PREFIX}__${type}`;
export function getMediaSegmentAction(userSettings: UserSettings, type: MediaSegmentType): MediaSegmentAction | undefined { export function getMediaSegmentAction(userSettings: UserSettings, type: MediaSegmentType): MediaSegmentAction {
const action = userSettings.get(getId(type), false); const action = userSettings.get(getId(type), false);
return action ? action as MediaSegmentAction : undefined; let defaultAction = MediaSegmentAction.None;
if (type === MediaSegmentType.Intro || type === MediaSegmentType.Outro) {
defaultAction = MediaSegmentAction.AskToSkip;
}
return action ? action as MediaSegmentAction : defaultAction;
} }

View file

@ -65,7 +65,7 @@ function populateMediaSegments(container, userSettings) {
].map(segmentType => { ].map(segmentType => {
const segmentTypeLabel = globalize.translate('LabelMediaSegmentsType', globalize.translate(`MediaSegmentType.${segmentType}`)); const segmentTypeLabel = globalize.translate('LabelMediaSegmentsType', globalize.translate(`MediaSegmentType.${segmentType}`));
const id = getId(segmentType); const id = getId(segmentType);
selectedValues[id] = getMediaSegmentAction(userSettings, segmentType) || MediaSegmentAction.None; selectedValues[id] = getMediaSegmentAction(userSettings, segmentType);
return `<div class="selectContainer"> return `<div class="selectContainer">
<select is="emby-select" id="${id}" class="segmentTypeAction" label="${segmentTypeLabel}"> <select is="emby-select" id="${id}" class="segmentTypeAction" label="${segmentTypeLabel}">
${actionOptions} ${actionOptions}