Use enum for item actions

This commit is contained in:
Bill Thornton
2025-12-03 17:28:45 -05:00
parent 7e663d57f1
commit cb8b2836c2
33 changed files with 318 additions and 216 deletions
+4 -1
View File
@@ -3,7 +3,10 @@ import type { ImageType } from '@jellyfin/sdk/lib/generated-client/models/image-
import type { UserItemDataDto } from '@jellyfin/sdk/lib/generated-client/models/user-item-data-dto';
import type { BaseItemDtoImageBlurHashes } from '@jellyfin/sdk/lib/generated-client/models/base-item-dto-image-blur-hashes';
import type { CollectionType } from '@jellyfin/sdk/lib/generated-client/models/collection-type';
import { ItemAction } from 'constants/itemAction';
import { CardShape } from 'utils/card';
import type { NullableString } from './base/common/shared/types';
import type { ItemDto } from './base/models/item-dto';
import type { ParentId } from './library';
@@ -44,7 +47,7 @@ export interface CardOptions {
showChildCountIndicator?: boolean;
lines?: number;
context?: CollectionType;
action?: string | null;
action?: ItemAction | null;
indexBy?: string;
parentId?: ParentId;
showMenu?: boolean;
+5 -2
View File
@@ -1,5 +1,8 @@
import type { CollectionType } from '@jellyfin/sdk/lib/generated-client/models/collection-type';
import type { UserItemDataDto } from '@jellyfin/sdk/lib/generated-client/models/user-item-data-dto';
import { ItemAction } from 'constants/itemAction';
import type { NullableBoolean, NullableNumber, NullableString } from './base/common/shared/types';
export type AttributesOpts = {
@@ -8,7 +11,7 @@ export type AttributesOpts = {
collectionId?: NullableString,
playlistId?: NullableString,
prefix?: NullableString,
action?: NullableString,
action?: ItemAction | null,
itemServerId?: NullableString,
itemId?: NullableString,
itemTimerId?: NullableString,
@@ -43,7 +46,7 @@ export type DataAttributes = {
'data-startdate'?: NullableString;
'data-enddate'?: NullableString;
'data-prefix'?: NullableString;
'data-action'?: NullableString;
'data-action'?: ItemAction | null;
'data-positionticks'?: NullableNumber;
'data-isfolder'?: NullableBoolean;
};
+5 -2
View File
@@ -1,13 +1,16 @@
import type { CollectionType } from '@jellyfin/sdk/lib/generated-client/models/collection-type';
import type { ItemSortBy } from '@jellyfin/sdk/lib/generated-client/models/item-sort-by';
import type { ItemDto } from './base/models/item-dto';
import type { TextLineOpts } from 'components/common/textLines/types';
import { ItemAction } from 'constants/itemAction';
import type { ItemDto } from './base/models/item-dto';
export interface ListOptions extends TextLineOpts {
items?: ItemDto[] | null;
index?: string;
showIndex?: boolean;
action?: string | null;
action?: ItemAction | null;
imageSize?: string;
enableOverview?: boolean;
enableSideMediaInfo?: boolean;