mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #5622 from grafixeyehero/Add-homevideos-view
Add Home videos and Photos View
This commit is contained in:
commit
085e6e7f3d
8 changed files with 112 additions and 1 deletions
|
@ -9,5 +9,7 @@ export const ASYNC_USER_ROUTES: AsyncRoute[] = [
|
|||
{ path: 'tv.html', page: 'shows', type: AsyncRouteType.Experimental },
|
||||
{ path: 'music.html', page: 'music', type: AsyncRouteType.Experimental },
|
||||
{ path: 'livetv.html', page: 'livetv', type: AsyncRouteType.Experimental },
|
||||
{ path: 'mypreferencesdisplay.html', page: 'user/display', type: AsyncRouteType.Experimental }
|
||||
{ path: 'mypreferencesdisplay.html', page: 'user/display', type: AsyncRouteType.Experimental },
|
||||
|
||||
{ path: 'homevideos.html', page: 'homevideos', type: AsyncRouteType.Experimental }
|
||||
];
|
||||
|
|
59
src/apps/experimental/routes/homevideos/index.tsx
Normal file
59
src/apps/experimental/routes/homevideos/index.tsx
Normal file
|
@ -0,0 +1,59 @@
|
|||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind';
|
||||
import React, { type 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 '@jellyfin/sdk/lib/generated-client/models/collection-type';
|
||||
import { LibraryTabContent, LibraryTabMapping } from 'types/libraryTabContent';
|
||||
|
||||
const photosTabContent: LibraryTabContent = {
|
||||
viewType: LibraryTab.Photos,
|
||||
collectionType: CollectionType.Homevideos,
|
||||
isBtnPlayAllEnabled: true,
|
||||
isBtnShuffleEnabled: true,
|
||||
itemType: [BaseItemKind.Photo]
|
||||
};
|
||||
|
||||
const photoAlbumsTabContent: LibraryTabContent = {
|
||||
viewType: LibraryTab.PhotoAlbums,
|
||||
collectionType: CollectionType.Homevideos,
|
||||
isBtnPlayAllEnabled: true,
|
||||
isBtnShuffleEnabled: true,
|
||||
itemType: [BaseItemKind.PhotoAlbum]
|
||||
};
|
||||
|
||||
const videosTabContent: LibraryTabContent = {
|
||||
viewType: LibraryTab.Videos,
|
||||
collectionType: CollectionType.Homevideos,
|
||||
isBtnPlayAllEnabled: true,
|
||||
isBtnShuffleEnabled: true,
|
||||
itemType: [BaseItemKind.Video]
|
||||
};
|
||||
|
||||
const homevideosTabMapping: LibraryTabMapping = {
|
||||
0: photosTabContent,
|
||||
1: photoAlbumsTabContent,
|
||||
2: videosTabContent
|
||||
};
|
||||
|
||||
const HomeVideos: FC = () => {
|
||||
const { libraryId, activeTab } = useCurrentTab();
|
||||
const currentTab = homevideosTabMapping[activeTab];
|
||||
|
||||
return (
|
||||
<Page
|
||||
id='homevideos'
|
||||
className='mainAnimatedPage libraryPage backdropPage collectionEditorPage pageWithAbsoluteTabs withTabs'
|
||||
backDropType='video, photo'
|
||||
>
|
||||
<PageTabContent
|
||||
key={`${currentTab.viewType} - ${libraryId}`}
|
||||
currentTab={currentTab}
|
||||
parentId={libraryId}
|
||||
/>
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
|
||||
export default HomeVideos;
|
Loading…
Add table
Add a link
Reference in a new issue