mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
Remove recently played carousel for jellyfin
This commit is contained in:
parent
1d82c84c9e
commit
46a23318af
1 changed files with 42 additions and 32 deletions
|
|
@ -1,16 +1,18 @@
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
import { Box, Stack } from '@mantine/core';
|
import { Box, Stack } from '@mantine/core';
|
||||||
import { useSetState } from '@mantine/hooks';
|
import { useSetState } from '@mantine/hooks';
|
||||||
import { AlbumListSort, SortOrder } from '/@/renderer/api/types';
|
import { AlbumListSort, ServerType, SortOrder } from '/@/renderer/api/types';
|
||||||
import { TextTitle, PageHeader, FeatureCarousel, GridCarousel } from '/@/renderer/components';
|
import { TextTitle, PageHeader, FeatureCarousel, GridCarousel } from '/@/renderer/components';
|
||||||
import { useAlbumList } from '/@/renderer/features/albums';
|
import { useAlbumList } from '/@/renderer/features/albums';
|
||||||
import { useRecentlyPlayed } from '/@/renderer/features/home/queries/recently-played-query';
|
import { useRecentlyPlayed } from '/@/renderer/features/home/queries/recently-played-query';
|
||||||
import { AnimatedPage } from '/@/renderer/features/shared';
|
import { AnimatedPage } from '/@/renderer/features/shared';
|
||||||
import { useContainerQuery } from '/@/renderer/hooks';
|
import { useContainerQuery } from '/@/renderer/hooks';
|
||||||
import { AppRoute } from '/@/renderer/router/routes';
|
import { AppRoute } from '/@/renderer/router/routes';
|
||||||
|
import { useCurrentServer } from '/@/renderer/store';
|
||||||
|
|
||||||
const HomeRoute = () => {
|
const HomeRoute = () => {
|
||||||
// const rootElement = document.querySelector(':root') as HTMLElement;
|
// const rootElement = document.querySelector(':root') as HTMLElement;
|
||||||
|
const server = useCurrentServer();
|
||||||
const cq = useContainerQuery();
|
const cq = useContainerQuery();
|
||||||
const itemsPerPage = cq.isXl ? 9 : cq.isLg ? 7 : cq.isMd ? 5 : cq.isSm ? 4 : 3;
|
const itemsPerPage = cq.isXl ? 9 : cq.isLg ? 7 : cq.isMd ? 5 : cq.isSm ? 4 : 3;
|
||||||
|
|
||||||
|
|
@ -223,39 +225,47 @@ const HomeRoute = () => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack spacing={35}>
|
<Stack spacing={35}>
|
||||||
<FeatureCarousel
|
<FeatureCarousel data={featureItemsWithImage} />
|
||||||
data={featureItemsWithImage}
|
{carousels
|
||||||
loading={feature.isLoading || feature.isFetching}
|
.filter((carousel) => {
|
||||||
/>
|
if (
|
||||||
{carousels.map((carousel, index) => (
|
server?.type === ServerType.JELLYFIN &&
|
||||||
<GridCarousel
|
carousel.uniqueId === 'recentlyPlayed'
|
||||||
key={`carousel-${carousel.uniqueId}-${index}`}
|
) {
|
||||||
cardRows={[
|
return null;
|
||||||
{
|
}
|
||||||
property: 'name',
|
|
||||||
route: {
|
return carousel;
|
||||||
route: AppRoute.LIBRARY_ALBUMS_DETAIL,
|
})
|
||||||
slugs: [{ idProperty: 'id', slugProperty: 'albumId' }],
|
.map((carousel, index) => (
|
||||||
|
<GridCarousel
|
||||||
|
key={`carousel-${carousel.uniqueId}-${index}`}
|
||||||
|
cardRows={[
|
||||||
|
{
|
||||||
|
property: 'name',
|
||||||
|
route: {
|
||||||
|
route: AppRoute.LIBRARY_ALBUMS_DETAIL,
|
||||||
|
slugs: [{ idProperty: 'id', slugProperty: 'albumId' }],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
arrayProperty: 'name',
|
||||||
arrayProperty: 'name',
|
property: 'albumArtists',
|
||||||
property: 'albumArtists',
|
route: {
|
||||||
route: {
|
route: AppRoute.LIBRARY_ALBUMARTISTS_DETAIL,
|
||||||
route: AppRoute.LIBRARY_ALBUMARTISTS_DETAIL,
|
slugs: [{ idProperty: 'id', slugProperty: 'albumArtistId' }],
|
||||||
slugs: [{ idProperty: 'id', slugProperty: 'albumArtistId' }],
|
},
|
||||||
},
|
},
|
||||||
},
|
]}
|
||||||
]}
|
containerWidth={cq.width}
|
||||||
containerWidth={cq.width}
|
data={carousel.data}
|
||||||
data={carousel.data}
|
loading={carousel.loading}
|
||||||
loading={carousel.loading}
|
pagination={carousel.pagination}
|
||||||
pagination={carousel.pagination}
|
uniqueId={carousel.uniqueId}
|
||||||
uniqueId={carousel.uniqueId}
|
>
|
||||||
>
|
<GridCarousel.Title>{carousel.title}</GridCarousel.Title>
|
||||||
<GridCarousel.Title>{carousel.title}</GridCarousel.Title>
|
</GridCarousel>
|
||||||
</GridCarousel>
|
))}
|
||||||
))}
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue