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

Add tv show view

This commit is contained in:
grafixeyehero 2023-10-26 02:05:38 +03:00
parent d370afd0b2
commit a05c6e4d58
4 changed files with 93 additions and 13 deletions

12
package-lock.json generated
View file

@ -6050,9 +6050,9 @@
"dev": true "dev": true
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001480", "version": "1.0.30001554",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001554.tgz",
"integrity": "sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ==", "integrity": "sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -26231,9 +26231,9 @@
"dev": true "dev": true
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001480", "version": "1.0.30001554",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001554.tgz",
"integrity": "sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ==", "integrity": "sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==",
"dev": true "dev": true
}, },
"canvas": { "canvas": {

View file

@ -5,5 +5,6 @@ export const ASYNC_USER_ROUTES: AsyncRoute[] = [
{ path: 'search.html', page: 'search' }, { path: 'search.html', page: 'search' },
{ path: 'userprofile.html', page: 'user/userprofile' }, { path: 'userprofile.html', page: 'user/userprofile' },
{ path: 'home.html', page: 'home', type: AsyncRouteType.Experimental }, { path: 'home.html', page: 'home', type: AsyncRouteType.Experimental },
{ path: 'movies.html', page: 'movies', type: AsyncRouteType.Experimental } { path: 'movies.html', page: 'movies', type: AsyncRouteType.Experimental },
{ path: 'tv.html', page: 'shows', type: AsyncRouteType.Experimental }
]; ];

View file

@ -61,12 +61,6 @@ export const LEGACY_USER_ROUTES: LegacyRoute[] = [
controller: 'user/subtitles/index', controller: 'user/subtitles/index',
view: 'user/subtitles/index.html' view: 'user/subtitles/index.html'
} }
}, {
path: 'tv.html',
pageProps: {
controller: 'shows/tvrecommended',
view: 'shows/tvrecommended.html'
}
}, { }, {
path: 'video', path: 'video',
pageProps: { pageProps: {

View file

@ -0,0 +1,85 @@
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind';
import React, { FC } from 'react';
import useCurrentTab from 'hooks/useCurrentTab';
import Page from 'components/Page';
import PageTabContent from '../../components/library/PageTabContent';
import { LibraryTab } from 'types/libraryTab';
import { CollectionType } from 'types/collectionType';
import { SectionsView } from 'types/suggestionsSections';
import { LibraryTabContent, LibraryTabMapping } from 'types/libraryTabContent';
const episodesTabContent: LibraryTabContent = {
viewType: LibraryTab.Episodes,
itemType: [BaseItemKind.Episode],
collectionType: CollectionType.TvShows,
isAlphabetPickerEnabled: false,
noItemsMessage: 'MessageNoEpisodesFound'
};
const seriesTabContent: LibraryTabContent = {
viewType: LibraryTab.Series,
itemType: [BaseItemKind.Series],
collectionType: CollectionType.TvShows,
isBtnShuffleEnabled: true
};
const networksTabContent: LibraryTabContent = {
viewType: LibraryTab.Networks,
itemType: [BaseItemKind.Series],
isBtnFilterEnabled: false,
isBtnGridListEnabled: false,
isBtnSortEnabled: false,
isAlphabetPickerEnabled: false
};
const upcomingTabContent: LibraryTabContent = {
viewType: LibraryTab.Upcoming
};
const suggestionsTabContent: LibraryTabContent = {
viewType: LibraryTab.Suggestions,
collectionType: CollectionType.TvShows,
sectionsType: {
suggestionSectionsView: [
SectionsView.ContinueWatchingEpisode,
SectionsView.LatestEpisode,
SectionsView.NextUp
]
}
};
const genresTabContent: LibraryTabContent = {
viewType: LibraryTab.Genres,
itemType: [BaseItemKind.Series],
collectionType: CollectionType.TvShows
};
const tvShowsTabMapping: LibraryTabMapping = {
0: seriesTabContent,
1: suggestionsTabContent,
2: upcomingTabContent,
3: genresTabContent,
4: networksTabContent,
5: episodesTabContent
};
const Shows: FC = () => {
const { searchParamsParentId, currentTabIndex } = useCurrentTab();
const currentTab = tvShowsTabMapping[currentTabIndex];
return (
<Page
id='tvshowsPage'
className='mainAnimatedPage libraryPage backdropPage collectionEditorPage pageWithAbsoluteTabs withTabs'
backDropType='series'
>
<PageTabContent
key={`${currentTab.viewType} - ${searchParamsParentId}`}
currentTab={currentTab}
parentId={searchParamsParentId}
/>
</Page>
);
};
export default Shows;