-
-
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.
- Loading branch information
1 parent
a1fb19e
commit ec26bfb
Showing
10 changed files
with
233 additions
and
7 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import ItemsView from '../../components/library/ItemsView'; | ||
import { CollectionType } from 'types/collectionType'; | ||
import { LibraryViewProps } from 'types/library'; | ||
import { LibraryTab } from 'types/libraryTab'; | ||
|
||
const AlbumArtistsView: FC<LibraryViewProps> = ({ parentId }) => { | ||
return ( | ||
<ItemsView | ||
viewType={LibraryTab.AlbumArtists} | ||
parentId={parentId} | ||
collectionType={CollectionType.Music} | ||
isBtnSortEnabled={false} | ||
itemType={[]} | ||
noItemsMessage='MessageNoItemsAvailable' | ||
/> | ||
); | ||
}; | ||
|
||
export default AlbumArtistsView; |
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,23 @@ | ||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client'; | ||
import React, { FC } from 'react'; | ||
|
||
import ItemsView from '../../components/library/ItemsView'; | ||
import { LibraryTab } from 'types/libraryTab'; | ||
import { LibraryViewProps } from 'types/library'; | ||
import { CollectionType } from 'types/collectionType'; | ||
|
||
const AlbumsView: FC<LibraryViewProps> = ({ parentId }) => { | ||
return ( | ||
<ItemsView | ||
viewType={LibraryTab.Albums} | ||
parentId={parentId} | ||
collectionType={CollectionType.Music} | ||
isBtnPlayAllEnabled={true} | ||
isBtnShuffleEnabled={true} | ||
itemType={[BaseItemKind.MusicAlbum]} | ||
noItemsMessage='MessageNoItemsAvailable' | ||
/> | ||
); | ||
}; | ||
|
||
export default AlbumsView; |
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,21 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import ItemsView from '../../components/library/ItemsView'; | ||
import { CollectionType } from 'types/collectionType'; | ||
import { LibraryViewProps } from 'types/library'; | ||
import { LibraryTab } from 'types/libraryTab'; | ||
|
||
const ArtistsView: FC<LibraryViewProps> = ({ parentId }) => { | ||
return ( | ||
<ItemsView | ||
viewType={LibraryTab.Artists} | ||
parentId={parentId} | ||
collectionType={CollectionType.Music} | ||
isBtnSortEnabled={false} | ||
itemType={[]} | ||
noItemsMessage='MessageNoItemsAvailable' | ||
/> | ||
); | ||
}; | ||
|
||
export default ArtistsView; |
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,18 @@ | ||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind'; | ||
import React, { FC } from 'react'; | ||
|
||
import GenresItemsContainer from '../../components/library/GenresItemsContainer'; | ||
import { LibraryViewProps } from 'types/library'; | ||
import { CollectionType } from 'types/collectionType'; | ||
|
||
const GenresView: FC<LibraryViewProps> = ({ parentId }) => { | ||
return ( | ||
<GenresItemsContainer | ||
parentId={parentId} | ||
collectionType={CollectionType.Music} | ||
itemType={BaseItemKind.MusicAlbum} | ||
/> | ||
); | ||
}; | ||
|
||
export default GenresView; |
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,23 @@ | ||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client'; | ||
import React, { FC } from 'react'; | ||
|
||
import ItemsView from '../../components/library/ItemsView'; | ||
import { LibraryViewProps } from 'types/library'; | ||
import { LibraryTab } from 'types/libraryTab'; | ||
|
||
const PlaylistsView: FC<LibraryViewProps> = ({ parentId }) => { | ||
return ( | ||
<ItemsView | ||
viewType={LibraryTab.Playlists} | ||
parentId={parentId} | ||
isBtnFilterEnabled={false} | ||
isBtnGridListEnabled={false} | ||
isBtnSortEnabled={false} | ||
isAlphabetPickerEnabled={false} | ||
itemType={[BaseItemKind.Playlist]} | ||
noItemsMessage='MessageNoItemsAvailable' | ||
/> | ||
); | ||
}; | ||
|
||
export default PlaylistsView; |
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,22 @@ | ||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client'; | ||
import React, { FC } from 'react'; | ||
|
||
import ItemsView from '../../components/library/ItemsView'; | ||
import { LibraryViewProps } from 'types/library'; | ||
import { LibraryTab } from 'types/libraryTab'; | ||
|
||
const SongsView: FC<LibraryViewProps> = ({ parentId }) => { | ||
return ( | ||
<ItemsView | ||
viewType={LibraryTab.Songs} | ||
parentId={parentId} | ||
//collectionType={CollectionType.Music} | ||
//isBtnGridListEnabled={false} | ||
isAlphabetPickerEnabled={false} | ||
itemType={[BaseItemKind.Audio]} | ||
noItemsMessage='MessageNoItemsAvailable' | ||
/> | ||
); | ||
}; | ||
|
||
export default SongsView; |
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,31 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import SuggestionsItemsContainer from '../../components/library/SuggestionsItemsContainer'; | ||
import FavoriteItemsContainer from '../../components/library/FavoriteItemsContainer'; | ||
import { LibraryViewProps } from 'types/library'; | ||
import { SectionsView } from 'types/suggestionsSections'; | ||
|
||
const SuggestionsView: FC<LibraryViewProps> = ({ parentId }) => { | ||
return ( | ||
<> | ||
<SuggestionsItemsContainer | ||
parentId={parentId} | ||
sectionsView={[ | ||
SectionsView.LatestMusic, | ||
SectionsView.FrequentlyPlayedMusic, | ||
SectionsView.RecentlyPlayedMusic | ||
]} | ||
/> | ||
<FavoriteItemsContainer | ||
parentId={parentId} | ||
sectionsView={[ | ||
SectionsView.FavoriteArtists, | ||
SectionsView.FavoriteAlbums, | ||
SectionsView.FavoriteSongs | ||
]} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default SuggestionsView; |
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,72 @@ | ||
import React, { FC } from 'react'; | ||
import { useLocation, useSearchParams } from 'react-router-dom'; | ||
|
||
import { getDefaultTabIndex } from '../../components/tabs/tabRoutes'; | ||
import Page from 'components/Page'; | ||
import GenresView from './GenresView'; | ||
import SuggestionsView from './SuggestionsView'; | ||
import AlbumArtistsView from './AlbumArtistsView'; | ||
import ArtistsView from './ArtistsView'; | ||
import PlaylistsView from './PlaylistsView'; | ||
import SongsView from './SongsView'; | ||
import AlbumsView from './AlbumsView'; | ||
|
||
const Shows: FC = () => { | ||
const location = useLocation(); | ||
const [ searchParams ] = useSearchParams(); | ||
const searchParamsParentId = searchParams.get('topParentId'); | ||
const searchParamsTab = searchParams.get('tab'); | ||
const currentTabIndex = searchParamsTab !== null ? parseInt(searchParamsTab, 10) : | ||
getDefaultTabIndex(location.pathname, searchParamsParentId); | ||
|
||
const getTabComponent = (index: number) => { | ||
if (index == null) { | ||
throw new Error('index cannot be null'); | ||
} | ||
|
||
let component; | ||
switch (index) { | ||
case 1: | ||
component = <SuggestionsView parentId={searchParamsParentId} />; | ||
break; | ||
|
||
case 2: | ||
component = <AlbumArtistsView parentId={searchParamsParentId} />; | ||
break; | ||
|
||
case 3: | ||
component = <ArtistsView parentId={searchParamsParentId} />; | ||
break; | ||
|
||
case 4: | ||
component = <PlaylistsView parentId={searchParamsParentId} />; | ||
break; | ||
|
||
case 5: | ||
component = <SongsView parentId={searchParamsParentId} />; | ||
break; | ||
|
||
case 6: | ||
component = <GenresView parentId={searchParamsParentId} />; | ||
break; | ||
|
||
default: | ||
component = <AlbumsView parentId={searchParamsParentId} />; | ||
} | ||
|
||
return component; | ||
}; | ||
|
||
return ( | ||
<Page | ||
id='musicPage' | ||
className='mainAnimatedPage libraryPage backdropPage collectionEditorPage pageWithAbsoluteTabs withTabs' | ||
backDropType='musicartist' | ||
> | ||
{getTabComponent(currentTabIndex)} | ||
|
||
</Page> | ||
); | ||
}; | ||
|
||
export default Shows; |