1
0
Fork 0
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:
Bill Thornton 2024-08-21 11:41:48 -04:00 committed by GitHub
commit d232494a89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 219 additions and 183 deletions

View file

@ -0,0 +1,7 @@
import { ItemDto } from './item-dto';
export interface ItemDtoQueryResult {
Items?: Array<ItemDto>;
TotalRecordCount?: number;
StartIndex?: number;
}

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View 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;