mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #5932 from grafixeyehero/Add-ItemDtoQueryResult-ItemStatus
Add shared ItemStatus and ItemDtoQueryResult Type
This commit is contained in:
commit
d232494a89
24 changed files with 219 additions and 183 deletions
7
src/types/base/models/item-dto-query-result.ts
Normal file
7
src/types/base/models/item-dto-query-result.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { ItemDto } from './item-dto';
|
||||
|
||||
export interface ItemDtoQueryResult {
|
||||
Items?: Array<ItemDto>;
|
||||
TotalRecordCount?: number;
|
||||
StartIndex?: number;
|
||||
}
|
|
@ -1,7 +1,10 @@
|
|||
import type { BaseItemDto, BaseItemKind, CollectionTypeOptions, RecordingStatus, SearchHint, SeriesTimerInfoDto, TimerInfoDto, UserItemDataDto, VirtualFolderInfo } from '@jellyfin/sdk/lib/generated-client';
|
||||
import type { BaseItemDto, CollectionTypeOptions, SearchHint, SeriesTimerInfoDto, TimerInfoDto, UserItemDataDto, VirtualFolderInfo } from '@jellyfin/sdk/lib/generated-client';
|
||||
import type { ItemStatus } from './item-status';
|
||||
import type { ItemKind } from './item-kind';
|
||||
import type { ItemMediaKind } from './item-media-kind';
|
||||
|
||||
type BaseItem = Omit<BaseItemDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Status' | 'Type' | 'Artists' | 'MediaType' | 'Name' | 'CollectionType'>;
|
||||
type TimerInfo = Omit<TimerInfoDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Status' | 'Type' | 'Name'>;
|
||||
type BaseItem = Omit<BaseItemDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Status' | 'Type' | 'Artists' | 'MediaType' | 'Name' | 'CollectionType' | 'CurrentProgram'>;
|
||||
type TimerInfo = Omit<TimerInfoDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Status' | 'Type' | 'Name' | 'ProgramInfo'>;
|
||||
type SeriesTimerInfo = Omit<SeriesTimerInfoDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Type' | 'Name'>;
|
||||
type SearchHintItem = Omit<SearchHint, 'ItemId' | 'Artists' | 'Id' | 'MediaType' | 'Name' | 'StartDate' | 'Type'>;
|
||||
type UserItem = Omit<UserItemDataDto, 'ItemId'>;
|
||||
|
@ -12,11 +15,13 @@ export interface ItemDto extends BaseItem, TimerInfo, SeriesTimerInfo, SearchHin
|
|||
'EndDate'?: string | null;
|
||||
'Id'?: string | null;
|
||||
'StartDate'?: string | null;
|
||||
'Type'?: BaseItemKind | string | null;
|
||||
'Status'?: RecordingStatus | string | null;
|
||||
'Type'?: ItemKind;
|
||||
'Status'?: ItemStatus;
|
||||
'CollectionType'?: CollectionTypeOptions | string | null;
|
||||
'Artists'?: Array<string> | null;
|
||||
'MediaType'?: string | null;
|
||||
'MediaType'?: ItemMediaKind;
|
||||
'Name'?: string | null;
|
||||
'ItemId'?: string | null;
|
||||
'ProgramInfo'?: ItemDto;
|
||||
'CurrentProgram'?: ItemDto;
|
||||
}
|
||||
|
|
|
@ -3,10 +3,9 @@ import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-ite
|
|||
export const ItemKind = {
|
||||
...BaseItemKind,
|
||||
Timer: 'Timer',
|
||||
SeriesTimer: 'SeriesTimer'
|
||||
SeriesTimer: 'SeriesTimer',
|
||||
AudioPodcast: 'AudioPodcast'
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export type ItemKind = keyof typeof ItemKind;
|
||||
|
||||
export type ItemType = ItemKind | null | undefined;
|
||||
export type ItemKind = typeof ItemKind[keyof typeof ItemKind] | undefined;
|
||||
|
|
|
@ -10,6 +10,4 @@ export const ItemMediaKind = {
|
|||
} as const;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export type ItemMediaKind = keyof typeof ItemMediaKind;
|
||||
|
||||
export type ItemMediaType = ItemMediaKind | null | undefined;
|
||||
export type ItemMediaKind = typeof ItemMediaKind[keyof typeof ItemMediaKind] | undefined;
|
||||
|
|
10
src/types/base/models/item-status.ts
Normal file
10
src/types/base/models/item-status.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { RecordingStatus } from '@jellyfin/sdk/lib/generated-client/models/recording-status';
|
||||
import { SeriesStatus } from '@jellyfin/sdk/lib/generated-client/models/series-status';
|
||||
|
||||
export const ItemStatus = {
|
||||
...RecordingStatus,
|
||||
...SeriesStatus
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export type ItemStatus = typeof ItemStatus[keyof typeof ItemStatus] | undefined;
|
Loading…
Add table
Add a link
Reference in a new issue