diff --git a/src/apps/stable/features/playback/constants/mediaSegmentAction.ts b/src/apps/stable/features/playback/constants/mediaSegmentAction.ts new file mode 100644 index 0000000000..c1eb9652f0 --- /dev/null +++ b/src/apps/stable/features/playback/constants/mediaSegmentAction.ts @@ -0,0 +1,7 @@ +/** + * Actions that are triggered for media segments. + */ +export enum MediaSegmentAction { + None = 'None', + Skip = 'Skip' +} diff --git a/src/components/playbackSettings/playbackSettings.js b/src/components/playbackSettings/playbackSettings.js index 1461dbb54d..d9688a210a 100644 --- a/src/components/playbackSettings/playbackSettings.js +++ b/src/components/playbackSettings/playbackSettings.js @@ -1,3 +1,8 @@ +import { MediaSegmentType } from '@jellyfin/sdk/lib/generated-client/models/media-segment-type'; +import escapeHTML from 'escape-html'; + +import { MediaSegmentAction } from 'apps/stable/features/playback/constants/mediaSegmentAction'; + import appSettings from '../../scripts/settings/appSettings'; import { appHost } from '../apphost'; import browser from '../../scripts/browser'; @@ -6,12 +11,12 @@ import qualityoptions from '../qualityOptions'; import globalize from '../../lib/globalize'; import loading from '../loading/loading'; import Events from '../../utils/events.ts'; -import '../../elements/emby-select/emby-select'; -import '../../elements/emby-checkbox/emby-checkbox'; import ServerConnections from '../ServerConnections'; import toast from '../toast/toast'; import template from './playbackSettings.template.html'; -import escapeHTML from 'escape-html'; + +import '../../elements/emby-select/emby-select'; +import '../../elements/emby-checkbox/emby-checkbox'; function fillSkipLengths(select) { const options = [5, 10, 15, 20, 25, 30]; @@ -40,6 +45,37 @@ function populateLanguages(select, languages) { select.innerHTML = html; } +function populateMediaSegments(container, userSettings) { + const selectedValues = {}; + const actionOptions = Object.values(MediaSegmentAction) + .map(action => { + const actionLabel = globalize.translate(`MediaSegmentAction.${action}`); + return ``; + }) + .join(''); + + const segmentSettings = Object.values(MediaSegmentType) + .map(segmentType => { + const segmentTypeLabel = globalize.translate('LabelMediaSegmentsType', globalize.translate(`MediaSegmentType.${segmentType}`)); + const id = `segmentTypeAction__${segmentType}`; + selectedValues[id] = userSettings.get(id, false) || MediaSegmentAction.None; + return `