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:
parent
809dba510a
commit
b93450098a
7 changed files with 179 additions and 14 deletions
|
@ -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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue