mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2026-09-03 03:50:02 +03:00
Refine types for incompatible api updates
This commit is contained in:
@@ -217,7 +217,6 @@ function getParentTitle(
|
||||
.map(artist => {
|
||||
const artistItem: ItemDto = {
|
||||
...artist,
|
||||
Key: artist.Id ?? '',
|
||||
Type: BaseItemKind.MusicArtist,
|
||||
IsFolder: true
|
||||
};
|
||||
@@ -512,7 +511,6 @@ function getChannelName(item: ItemDto) {
|
||||
if (item.ChannelId) {
|
||||
return getTextActionButton(
|
||||
{
|
||||
Key: item.ChannelId,
|
||||
Id: item.ChannelId,
|
||||
ServerId: item.ServerId,
|
||||
Name: item.ChannelName,
|
||||
@@ -600,7 +598,6 @@ function getMediaTitle(cardOptions: CardOptions, item: ItemDto): TextLine {
|
||||
});
|
||||
|
||||
return getTextActionButton({
|
||||
Key: item.Id ?? '',
|
||||
Id: item.Id,
|
||||
ServerId: item.ServerId,
|
||||
Name: name,
|
||||
@@ -623,7 +620,6 @@ function getParentTitleOrTitle(
|
||||
) {
|
||||
if (item.SeriesId) {
|
||||
return getTextActionButton({
|
||||
Key: item.SeriesId,
|
||||
Id: item.SeriesId,
|
||||
ServerId: item.ServerId,
|
||||
Name: item.SeriesName,
|
||||
|
||||
@@ -512,7 +512,7 @@ function usePrimaryMediaInfo({
|
||||
showYearInfo,
|
||||
ProductionYear,
|
||||
Type,
|
||||
Status,
|
||||
Status as ItemStatus,
|
||||
EndDate,
|
||||
addMiscInfo
|
||||
);
|
||||
|
||||
@@ -7,7 +7,7 @@ type BaseItem = Omit<BaseItemDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' |
|
||||
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'>;
|
||||
type UserItem = Omit<UserItemDataDto, 'ItemId' | 'Key'>;
|
||||
type VirtualFolder = Omit<VirtualFolderInfo, 'CollectionType'>;
|
||||
|
||||
export interface ItemDto extends BaseItem, TimerInfo, SeriesTimerInfo, SearchHintItem, UserItem, VirtualFolder {
|
||||
@@ -16,7 +16,7 @@ export interface ItemDto extends BaseItem, TimerInfo, SeriesTimerInfo, SearchHin
|
||||
'Id'?: string | null;
|
||||
'StartDate'?: string | null;
|
||||
'Type'?: ItemKind;
|
||||
'Status'?: ItemStatus;
|
||||
'Status'?: ItemStatus | string | null;
|
||||
'CollectionType'?: CollectionTypeOptions | string | null;
|
||||
'Artists'?: Array<string> | null;
|
||||
'MediaType'?: ItemMediaKind;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { MediaType } from '@jellyfin/sdk/lib/generated-client/models/media-type';
|
||||
|
||||
export const ItemMediaKind = {
|
||||
...MediaType,
|
||||
MusicArtist: 'MusicArtist',
|
||||
Playlist: 'Playlist',
|
||||
MusicGenre: 'MusicGenre',
|
||||
Photo: 'Photo',
|
||||
Audio: 'Audio',
|
||||
Video: 'Video',
|
||||
Book: 'Book',
|
||||
Recording: 'Recording'
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -7,4 +7,4 @@ export const ItemStatus = {
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export type ItemStatus = typeof ItemStatus[keyof typeof ItemStatus] | undefined;
|
||||
export type ItemStatus = typeof ItemStatus[keyof typeof ItemStatus] | null | undefined;
|
||||
|
||||
Reference in New Issue
Block a user