1+ import { ItemFields } from '@jellyfin/sdk/lib/generated-client/models/item-fields' ;
12import type { RecommendationDto } from '@jellyfin/sdk/lib/generated-client/models/recommendation-dto' ;
23import { RecommendationType } from '@jellyfin/sdk/lib/generated-client/models/recommendation-type' ;
34import React , { type FC } from 'react' ;
45
56import { CardShape } from 'components/cardbuilder/utils/shape' ;
67import { useApi } from 'hooks/useApi' ;
7- import {
8- useGetMovieRecommendations ,
9- useGetSuggestionSectionsWithItems
10- } from 'hooks/useFetchItems' ;
8+ import { useGetSuggestionSectionsWithItems } from 'hooks/useFetchItems' ;
119import { appRouter } from 'components/router/appRouter' ;
1210import globalize from 'lib/globalize' ;
1311import Loading from 'components/loading/LoadingComponent' ;
@@ -17,6 +15,8 @@ import type { ParentId } from 'types/library';
1715import type { Section , SectionType } from 'types/sections' ;
1816import type { ItemDto } from 'types/base/models/item-dto' ;
1917
18+ import { useMovieRecommendations } from '../hooks/api/useMovieRecommendations' ;
19+
2020interface SuggestionsSectionViewProps {
2121 parentId : ParentId ;
2222 sectionType : SectionType [ ] ;
@@ -35,7 +35,15 @@ const SuggestionsSectionView: FC<SuggestionsSectionViewProps> = ({
3535 const {
3636 isLoading : isRecommendationsLoading ,
3737 data : movieRecommendationsItems
38- } = useGetMovieRecommendations ( isMovieRecommendationEnabled , parentId ) ;
38+ } = useMovieRecommendations ( {
39+ parentId : parentId || undefined ,
40+ fields : [
41+ ItemFields . PrimaryImageAspectRatio ,
42+ ItemFields . MediaSourceCount
43+ ] ,
44+ categoryLimit : 6 ,
45+ itemLimit : 20
46+ } , isMovieRecommendationEnabled ) ;
3947
4048 if ( isLoading || isRecommendationsLoading ) {
4149 return < Loading /> ;
0 commit comments