-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5622 from grafixeyehero/Add-homevideos-view
Add Home videos and Photos View
- Loading branch information
Showing
8 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters