1
0
Fork 0
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:
Bill Thornton 2024-07-15 13:17:14 -04:00 committed by GitHub
commit 085e6e7f3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 112 additions and 1 deletions

View file

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

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