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

Add media segment manager

This commit is contained in:
Bill Thornton 2024-10-02 17:09:59 -04:00
parent 809dba510a
commit b93450098a
7 changed files with 179 additions and 14 deletions

View file

@ -0,0 +1,14 @@
import { MediaSegmentType } from '@jellyfin/sdk/lib/generated-client/models/media-segment-type';
import { UserSettings } from 'scripts/settings/userSettings';
import { MediaSegmentAction } from '../constants/mediaSegmentAction';
const PREFIX = 'segmentTypeAction';
export const getId = (type: MediaSegmentType) => `${PREFIX}__${type}`;
export function getMediaSegmentAction(userSettings: UserSettings, type: MediaSegmentType): MediaSegmentAction | undefined {
const action = userSettings.get(getId(type), false);
return action ? action as MediaSegmentAction : undefined;
}