From aa60e320c5edf1e25f834ad13dcb70d24e90d5ea Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Mon, 26 Aug 2024 08:49:12 +0200 Subject: [PATCH] feat: split episodes and movies --- app/(auth)/(tabs)/(home)/index.tsx | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/app/(auth)/(tabs)/(home)/index.tsx b/app/(auth)/(tabs)/(home)/index.tsx index fc78cc50..749253f0 100644 --- a/app/(auth)/(tabs)/(home)/index.tsx +++ b/app/(auth)/(tabs)/(home)/index.tsx @@ -1,4 +1,3 @@ -import { Button } from "@/components/Button"; import { Text } from "@/components/common/Text"; import { LargeMovieCarousel } from "@/components/home/LargeMovieCarousel"; import { ScrollingCollectionList } from "@/components/home/ScrollingCollectionList"; @@ -6,7 +5,6 @@ import { Loader } from "@/components/Loader"; import { MediaListSection } from "@/components/medialists/MediaListSection"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; import { useSettings } from "@/utils/atoms/settings"; -import { Ionicons } from "@expo/vector-icons"; import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { getItemsApi, @@ -41,7 +39,6 @@ type MediaListSection = BaseSection & { type Section = ScrollingCollectionListSection | MediaListSection; export default function index() { - const router = useRouter(); const queryClient = useQueryClient(); const [api] = useAtom(apiAtom); @@ -211,14 +208,30 @@ export default function index() { type: "ScrollingCollectionList", }, { - title: "Suggestions", - queryKey: ["suggestions", user?.Id], + title: "Suggested Movies", + queryKey: ["suggestedMovies", user?.Id], queryFn: async () => ( await getSuggestionsApi(api).getSuggestions({ userId: user?.Id, - limit: 5, + limit: 10, mediaType: ["Video"], + type: ["Movie"], + }) + ).data.Items || [], + type: "ScrollingCollectionList", + orientation: "vertical", + }, + { + title: "Suggested Episodes", + queryKey: ["suggestedEpisodes", user?.Id], + queryFn: async () => + ( + await getSuggestionsApi(api).getSuggestions({ + userId: user?.Id, + limit: 10, + mediaType: ["Video"], + type: ["Episode"], }) ).data.Items || [], type: "ScrollingCollectionList",