diff --git a/app/(auth)/(tabs)/(home)/index.tsx b/app/(auth)/(tabs)/(home)/index.tsx index c665059d..a4621335 100644 --- a/app/(auth)/(tabs)/(home)/index.tsx +++ b/app/(auth)/(tabs)/(home)/index.tsx @@ -157,43 +157,34 @@ export default function index() { if (!api || !user?.Id) return []; const ss: Section[] = [ - { - title: "Continue Watching", - queryKey: ["resumeItems", user.Id], - queryFn: async () => - ( - await getItemsApi(api).getResumeItems({ - userId: user.Id, - enableImageTypes: ["Primary", "Backdrop", "Thumb"], - }) - ).data.Items || [], - type: "ScrollingCollectionList", - orientation: "horizontal", - }, - { - title: "Next Up", - queryKey: ["nextUp-all", user?.Id], - queryFn: async () => - ( - await getTvShowsApi(api).getNextUp({ - userId: user?.Id, - fields: ["MediaSourceCount"], - limit: 20, - enableImageTypes: ["Primary", "Backdrop", "Thumb"], - }) - ).data.Items || [], - type: "ScrollingCollectionList", - orientation: "horizontal", - }, - ...(mediaListCollections?.map( - (ml) => - ({ - title: ml.Name || "", - queryKey: ["mediaList", ml.Id], - queryFn: async () => ml, - type: "MediaListSection", - } as MediaListSection) - ) || []), + // { + // title: "Continue Watching", + // queryKey: ["resumeItems", user.Id], + // queryFn: async () => + // ( + // await getItemsApi(api).getResumeItems({ + // userId: user.Id, + // enableImageTypes: ["Primary", "Backdrop", "Thumb"], + // }) + // ).data.Items || [], + // type: "ScrollingCollectionList", + // orientation: "horizontal", + // }, + // { + // title: "Next Up", + // queryKey: ["nextUp-all", user?.Id], + // queryFn: async () => + // ( + // await getTvShowsApi(api).getNextUp({ + // userId: user?.Id, + // fields: ["MediaSourceCount"], + // limit: 20, + // enableImageTypes: ["Primary", "Backdrop", "Thumb"], + // }) + // ).data.Items || [], + // type: "ScrollingCollectionList", + // orientation: "horizontal", + // }, { title: "Recently Added in Movies", queryKey: ["recentlyAddedInMovies", user?.Id, movieCollectionId], @@ -228,6 +219,15 @@ export default function index() { ).data || [], type: "ScrollingCollectionList", }, + ...(mediaListCollections?.map( + (ml) => + ({ + title: ml.Name || "", + queryKey: ["mediaList", ml.Id], + queryFn: async () => ml, + type: "MediaListSection", + } as MediaListSection) + ) || []), { title: "Suggested Movies", queryKey: ["suggestedMovies", user?.Id], @@ -317,7 +317,7 @@ export default function index() { const insets = useSafeAreaInsets(); - if (e1 || e2) + if (e1 || e2 || !api) return ( Oops! @@ -341,39 +341,69 @@ export default function index() { refreshControl={ } + key={"home"} + contentContainerStyle={{ + paddingLeft: insets.left, + paddingRight: insets.right, + }} + className="flex flex-col space-y-4 mb-20" > - - + - {sections.map((section, index) => { - if (section.type === "ScrollingCollectionList") { - return ( - - ); - } else if (section.type === "MediaListSection") { - return ( - - ); - } - return null; - })} - + + ( + await getTvShowsApi(api).getNextUp({ + userId: user?.Id, + fields: ["MediaSourceCount"], + limit: 20, + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + }) + ).data.Items|| [] + } + orientation={"horizontal"} + /> + + + ( + await getItemsApi(api).getResumeItems({ + userId: user?.Id, + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + }) + ).data.Items || [] + } + orientation={"horizontal"} + /> + + {sections.map((section, index) => { + if (section.type === "ScrollingCollectionList") { + return ( + + ); + } else if (section.type === "MediaListSection") { + return ( + + ); + } + return null; + })} ); } diff --git a/components/ContinueWatchingPoster.tsx b/components/ContinueWatchingPoster.tsx index c93ec275..7dda9dfc 100644 --- a/components/ContinueWatchingPoster.tsx +++ b/components/ContinueWatchingPoster.tsx @@ -76,10 +76,7 @@ const ContinueWatchingPoster: React.FC = ({ {progress > 0 && ( <> { pauseVideo, playVideo, stopPlayback, - setVolume, setIsPlaying, isPlaying, videoRef, @@ -77,7 +66,6 @@ export const FullScreenVideoPlayer: React.FC = () => { const [showControls, setShowControls] = useState(true); const [isBuffering, setIsBufferingState] = useState(true); const [ignoreSafeArea, setIgnoreSafeArea] = useState(false); - const [isStatusBarHidden, setIsStatusBarHidden] = useState(false); // Seconds const [currentTime, setCurrentTime] = useState(0); diff --git a/components/home/LargeMovieCarousel.tsx b/components/home/LargeMovieCarousel.tsx index fa77d736..11676b88 100644 --- a/components/home/LargeMovieCarousel.tsx +++ b/components/home/LargeMovieCarousel.tsx @@ -84,13 +84,7 @@ export const LargeMovieCarousel: React.FC = ({ ...props }) => { const width = Dimensions.get("screen").width; - if (l1 || l2) - return ( - - - - ); - + if (l1 || l2) return null; if (!popularItems) return null; return ( diff --git a/components/home/ScrollingCollectionList.tsx b/components/home/ScrollingCollectionList.tsx index 5e117467..e8420d72 100644 --- a/components/home/ScrollingCollectionList.tsx +++ b/components/home/ScrollingCollectionList.tsx @@ -1,6 +1,5 @@ import { Text } from "@/components/common/Text"; import MoviePoster from "@/components/posters/MoviePoster"; -import { useSettings } from "@/utils/atoms/settings"; import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { useQuery, @@ -17,7 +16,6 @@ import SeriesPoster from "../posters/SeriesPoster"; interface Props extends ViewProps { title?: string | null; orientation?: "horizontal" | "vertical"; - height?: "small" | "large"; disabled?: boolean; queryKey: QueryKey; queryFn: QueryFunction; @@ -26,13 +24,11 @@ interface Props extends ViewProps { export const ScrollingCollectionList: React.FC = ({ title, orientation = "vertical", - height = "small", disabled = false, queryFn, queryKey, ...props }) => { - const [settings] = useSettings(); const { data, isLoading } = useQuery({ queryKey, queryFn, @@ -49,32 +45,31 @@ export const ScrollingCollectionList: React.FC = ({ ( - - {item.Type === "Episode" && orientation === "horizontal" && ( - - )} - {item.Type === "Episode" && orientation === "vertical" && ( - - )} - {item.Type === "Movie" && orientation === "horizontal" && ( - - )} - {item.Type === "Movie" && orientation === "vertical" && ( - - )} - {item.Type === "Series" && } - - + {item.Type === "Episode" && orientation === "horizontal" && ( + + )} + {item.Type === "Episode" && orientation === "vertical" && ( + + )} + {item.Type === "Movie" && orientation === "horizontal" && ( + + )} + {item.Type === "Movie" && orientation === "vertical" && ( + + )} + {item.Type === "Series" && } + )} />