1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

refactor: suggestionview and genresview

This commit is contained in:
grafixeyehero 2023-06-07 03:38:39 +03:00
parent 13aa3c9efa
commit 17e8ccc93a
27 changed files with 1253 additions and 602 deletions

74
src/types/cardOptions.ts Normal file
View file

@ -0,0 +1,74 @@
import type { BaseItemDto } from '@jellyfin/sdk/lib/generated-client';
export interface CardOptions {
itemsContainer?: HTMLElement | null;
parentContainer?: HTMLElement | null;
items?: BaseItemDto[] | null;
allowBottomPadding?: boolean;
centerText?: boolean;
coverImage?: boolean;
inheritThumb?: boolean;
overlayMoreButton?: boolean;
overlayPlayButton?: boolean;
overlayText?: boolean;
preferThumb?: boolean;
preferDisc?: boolean;
preferLogo?: boolean;
scalable?: boolean;
shape?: string | null;
lazy?: boolean;
cardLayout?: boolean | string;
showParentTitle?: boolean;
showParentTitleOrTitle?: boolean;
showAirTime?: boolean;
showAirDateTime?: boolean;
showChannelName?: boolean;
showTitle?: boolean | string;
showYear?: boolean | string;
showDetailsMenu?: boolean;
missingIndicator?: boolean;
showLocationTypeIndicator?: boolean;
showSeriesYear?: boolean;
showUnplayedIndicator?: boolean;
showChildCountIndicator?: boolean;
lines?: number;
context?: string | null;
action?: string | null;
defaultShape?: string;
indexBy?: string;
parentId?: string | null;
showMenu?: boolean;
cardCssClass?: string | null;
cardClass?: string | null;
centerPlayButton?: boolean;
overlayInfoButton?: boolean;
autoUpdate?: boolean;
cardFooterAside?: string;
includeParentInfoInTitle?: boolean;
maxLines?: number;
overlayMarkPlayedButton?: boolean;
overlayRateButton?: boolean;
showAirEndTime?: boolean;
showCurrentProgram?: boolean;
showCurrentProgramTime?: boolean;
showItemCounts?: boolean;
showPersonRoleOrType?: boolean;
showProgressBar?: boolean;
showPremiereDate?: boolean;
showRuntime?: boolean;
showSeriesTimerTime?: boolean;
showSeriesTimerChannel?: boolean;
showSongCount?: boolean;
width?: number;
showChannelLogo?: boolean;
showLogo?: boolean;
serverId?: string;
collectionId?: string | null;
playlistId?: string | null;
defaultCardImageIcon?: string;
disableHoverMenu?: boolean;
disableIndicators?: boolean;
showGroupCount?: boolean;
containerClass?: string;
noItemsMessage?: string;
}

View file

@ -1,19 +1,3 @@
import type { BaseItemDto } from '@jellyfin/sdk/lib/generated-client';
export interface Query extends ViewQuerySettings {
IncludeItemTypes?: string;
Recursive?: boolean;
Fields?: string | null;
ImageTypeLimit?: number;
EnableTotalRecordCount?: boolean;
EnableImageTypes?: string;
StartIndex?: number;
ParentId?: string | null;
IsMissing?: boolean | null;
Limit?:number;
Filters?: string | null;
}
export interface ViewQuerySettings {
showTitle?: boolean;
showYear?: boolean;
@ -43,80 +27,3 @@ export interface ViewQuerySettings {
NameStartsWith?: string | null;
StartIndex?: number;
}
export interface CardOptions {
itemsContainer?: HTMLElement | null;
parentContainer?: HTMLElement | null;
items?: BaseItemDto[] | null;
allowBottomPadding?: boolean;
centerText?: boolean;
coverImage?: boolean;
inheritThumb?: boolean;
overlayMoreButton?: boolean;
overlayPlayButton?: boolean;
overlayText?: boolean;
preferThumb?: boolean;
preferDisc?: boolean;
preferLogo?: boolean;
scalable?: boolean;
shape?: string | null;
lazy?: boolean;
cardLayout?: boolean | string;
showParentTitle?: boolean;
showParentTitleOrTitle?: boolean;
showAirTime?: boolean;
showAirDateTime?: boolean;
showChannelName?: boolean;
showTitle?: boolean | string;
showYear?: boolean | string;
showDetailsMenu?: boolean;
missingIndicator?: boolean;
showLocationTypeIndicator?: boolean;
showSeriesYear?: boolean;
showUnplayedIndicator?: boolean;
showChildCountIndicator?: boolean;
lines?: number;
context?: string | null;
action?: string | null;
defaultShape?: string;
indexBy?: string;
parentId?: string | null;
showMenu?: boolean;
cardCssClass?: string | null;
cardClass?: string | null;
centerPlayButton?: boolean;
overlayInfoButton?: boolean;
autoUpdate?: boolean;
cardFooterAside?: string;
includeParentInfoInTitle?: boolean;
maxLines?: number;
overlayMarkPlayedButton?: boolean;
overlayRateButton?: boolean;
showAirEndTime?: boolean;
showCurrentProgram?: boolean;
showCurrentProgramTime?: boolean;
showItemCounts?: boolean;
showPersonRoleOrType?: boolean;
showProgressBar?: boolean;
showPremiereDate?: boolean;
showRuntime?: boolean;
showSeriesTimerTime?: boolean;
showSeriesTimerChannel?: boolean;
showSongCount?: boolean;
width?: number;
showChannelLogo?: boolean;
showLogo?: boolean;
serverId?: string;
collectionId?: string | null;
playlistId?: string | null;
defaultCardImageIcon?: string;
disableHoverMenu?: boolean;
disableIndicators?: boolean;
showGroupCount?: boolean;
containerClass?: string;
noItemsMessage?: string;
}
export interface LibraryViewProps {
topParentId: string | null;
}

45
src/types/library.ts Normal file
View file

@ -0,0 +1,45 @@
import { ItemFields } from '@jellyfin/sdk/lib/generated-client/models/item-fields';
import { ItemFilter } from '@jellyfin/sdk/lib/generated-client/models/item-filter';
import { VideoType } from '@jellyfin/sdk/lib/generated-client/models/video-type';
import { ImageType } from '@jellyfin/sdk/lib/generated-client/models/image-type';
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind';
import { ItemSortBy } from '@jellyfin/sdk/lib/models/api/item-sort-by';
import { SortOrder } from '@jellyfin/sdk/lib/generated-client/models/sort-order';
import { SeriesStatus } from '@jellyfin/sdk/lib/generated-client/models/series-status';
export interface ParametersOptions {
sortBy?: ItemSortBy[];
sortOrder?: SortOrder[];
includeItemTypes?: BaseItemKind[];
fields?: ItemFields[];
enableImageTypes?: ImageType[];
videoTypes?: VideoType[];
seriesStatus?: SeriesStatus[];
filters?: ItemFilter[];
limit?: number;
isFavorite?: boolean;
genres?: string[];
officialRatings?: string[];
tags?: string[];
years?: number[];
is4K?: boolean;
isHd?: boolean;
is3D?: boolean;
hasSubtitles?: boolean;
hasTrailer?: boolean;
hasSpecialFeature?: boolean;
hasThemeSong?: boolean;
hasThemeVideo?: boolean;
parentIndexNumber?: number;
isMissing?: boolean;
isUnaired?: boolean;
startIndex?: number;
nameLessThan?: string;
nameStartsWith?: string;
collapseBoxSetItems?: boolean;
enableTotalRecordCount?: boolean;
}
export interface LibraryViewProps {
parentId: string | null;
}

View file

@ -0,0 +1,28 @@
import { CardOptions } from './cardOptions';
import { ParametersOptions } from './library';
export enum SectionsViewType {
ResumeItems = 'resumeItems',
LatestMedia = 'latestMedia',
NextUp = 'nextUp',
}
export enum SectionsView {
ContinueWatchingMovies = 'continuewatchingmovies',
LatestMovies = 'latestmovies',
ContinueWatchingEpisode = 'continuewatchingepisode',
LatestEpisode = 'latestepisode',
NextUp = 'nextUp',
LatestMusic = 'latestmusic',
RecentlyPlayedMusic = 'recentlyplayedmusic',
FrequentlyPlayedMusic = 'frequentlyplayedmusic',
}
export interface Sections {
name: string;
view: SectionsView;
type: string;
viewType?: SectionsViewType,
parametersOptions?: ParametersOptions;
cardOptions: CardOptions;
}