diff --git a/app/(auth)/(tabs)/(home)/index.tsx b/app/(auth)/(tabs)/(home)/index.tsx index cc02e39e..f5b1a68e 100644 --- a/app/(auth)/(tabs)/(home)/index.tsx +++ b/app/(auth)/(tabs)/(home)/index.tsx @@ -354,6 +354,7 @@ export default function index() { paddingLeft: insets.left, paddingRight: insets.right, paddingTop: 8, + paddingBottom: 8, rowGap: 8, }} style={{ diff --git a/app/(auth)/(tabs)/(home,libraries,search)/series/[id].tsx b/app/(auth)/(tabs)/(home,libraries,search)/series/[id].tsx index 0ff4881b..edef436c 100644 --- a/app/(auth)/(tabs)/(home,libraries,search)/series/[id].tsx +++ b/app/(auth)/(tabs)/(home,libraries,search)/series/[id].tsx @@ -10,6 +10,7 @@ import { useQuery } from "@tanstack/react-query"; import { Image } from "expo-image"; import { useLocalSearchParams } from "expo-router"; import { useAtom } from "jotai"; +import React from "react"; import { useEffect, useMemo } from "react"; import { View } from "react-native"; diff --git a/bun.lockb b/bun.lockb index f20d90a6..804a930b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/ContinueWatchingPoster.tsx b/components/ContinueWatchingPoster.tsx index aa1f2cbc..2bd3e3ea 100644 --- a/components/ContinueWatchingPoster.tsx +++ b/components/ContinueWatchingPoster.tsx @@ -9,13 +9,14 @@ import React from "react"; type ContinueWatchingPosterProps = { item: BaseItemDto; - width?: number; useEpisodePoster?: boolean; + size?: "small" | "normal"; }; const ContinueWatchingPoster: React.FC = ({ item, useEpisodePoster = false, + size = "normal", }) => { const [api] = useAtom(apiAtom); @@ -51,7 +52,12 @@ const ContinueWatchingPoster: React.FC = ({ ); return ( - + = ({ item }) => { return ( - + {item.Type === "Episode" ? ( <> diff --git a/components/ItemContent.tsx b/components/ItemContent.tsx index 4daee193..30d936cf 100644 --- a/components/ItemContent.tsx +++ b/components/ItemContent.tsx @@ -125,6 +125,7 @@ export const ItemContent: React.FC<{ id: string }> = React.memo(({ id }) => { }); const [localItem, setLocalItem] = useState(item); + useImageColors(item); useEffect(() => { if (item) { @@ -234,18 +235,6 @@ export const ItemContent: React.FC<{ id: string }> = React.memo(({ id }) => { }); const logoUrl = useMemo(() => getLogoImageUrlById({ api, item }), [item]); - const themeImageColorSource = useMemo(() => { - if (!api || !item) return; - return getItemImage({ - item, - api, - variant: "Primary", - quality: 80, - width: 300, - }); - }, [api, item]); - - useImageColors(themeImageColorSource?.uri); const loading = useMemo(() => { return Boolean(isLoading || isFetching || (logoUrl && loadingLogo)); @@ -274,7 +263,6 @@ export const ItemContent: React.FC<{ id: string }> = React.memo(({ id }) => { {localItem && ( = React.memo(({ id }) => { )} - + diff --git a/components/ItemHeader.tsx b/components/ItemHeader.tsx index 74d29725..24fb297a 100644 --- a/components/ItemHeader.tsx +++ b/components/ItemHeader.tsx @@ -4,6 +4,7 @@ import { MoviesTitleHeader } from "./movies/MoviesTitleHeader"; import { Ratings } from "./Ratings"; import { EpisodeTitleHeader } from "./series/EpisodeTitleHeader"; import { GenreTags } from "./GenreTags"; +import React from "react"; interface Props extends ViewProps { item?: BaseItemDto | null; diff --git a/components/common/ItemImage.tsx b/components/common/ItemImage.tsx index bf4c0f1a..9e38bc06 100644 --- a/components/common/ItemImage.tsx +++ b/components/common/ItemImage.tsx @@ -22,7 +22,6 @@ interface Props extends ImageProps { | "Thumb"; quality?: number; width?: number; - useThemeColor?: boolean; onError?: () => void; } @@ -31,7 +30,6 @@ export const ItemImage: React.FC = ({ variant = "Primary", quality = 90, width = 1000, - useThemeColor = false, onError, ...props }) => { diff --git a/components/home/ScrollingCollectionList.tsx b/components/home/ScrollingCollectionList.tsx index 433f9877..0d47d112 100644 --- a/components/home/ScrollingCollectionList.tsx +++ b/components/home/ScrollingCollectionList.tsx @@ -51,10 +51,24 @@ export const ScrollingCollectionList: React.FC = ({ `} > {[1, 2, 3].map((i) => ( - - - - + + + + + Nisi mollit voluptate amet. + + + + + Lorem ipsum + + ))} diff --git a/components/series/SeasonPicker.tsx b/components/series/SeasonPicker.tsx index 0c6f9a0e..b0da7661 100644 --- a/components/series/SeasonPicker.tsx +++ b/components/series/SeasonPicker.tsx @@ -198,11 +198,11 @@ export const SeasonPicker: React.FC = ({ item, initialSeasonIndex }) => { key={e.Id} className="flex flex-col mb-4" > - - + + @@ -217,7 +217,7 @@ export const SeasonPicker: React.FC = ({ item, initialSeasonIndex }) => { {runtimeTicksToSeconds(e.RunTimeTicks)} - + diff --git a/components/settings/SettingToggles.tsx b/components/settings/SettingToggles.tsx index c5ba0240..0688226a 100644 --- a/components/settings/SettingToggles.tsx +++ b/components/settings/SettingToggles.tsx @@ -50,41 +50,32 @@ export const SettingToggles: React.FC = ({ ...props }) => { const queryClient = useQueryClient(); - const { data: optimizeServerStatistics } = useQuery({ - queryKey: ["optimize-server", settings?.optimizedVersionsServerUrl], - queryFn: async () => - getStatistics({ - url: settings?.optimizedVersionsServerUrl, - authHeader: api?.accessToken, - deviceId: await getOrSetDeviceId(), - }), - refetchInterval: 1000, - staleTime: 0, - enabled: - !!settings?.optimizedVersionsServerUrl && - settings.optimizedVersionsServerUrl.length > 0, - }); - /******************** * Background task *******************/ - useEffect(() => { - checkStatusAsync(); - }, []); - const checkStatusAsync = async () => { await BackgroundFetch.getStatusAsync(); - await TaskManager.isTaskRegisteredAsync(BACKGROUND_FETCH_TASK); + return await TaskManager.isTaskRegisteredAsync(BACKGROUND_FETCH_TASK); }; useEffect(() => { - if (settings?.autoDownload) { - registerBackgroundFetchAsync(); - } else { - unregisterBackgroundFetchAsync(); - } + (async () => { + const registered = await checkStatusAsync(); - checkStatusAsync(); + if (settings?.autoDownload === true && !registered) { + registerBackgroundFetchAsync(); + toast.success("Background downlodas enabled"); + } else if (settings?.autoDownload === false && registered) { + unregisterBackgroundFetchAsync(); + toast.info("Background downloads disabled"); + } else if (settings?.autoDownload === true && registered) { + // Don't to anything + } else if (settings?.autoDownload === false && !registered) { + // Don't to anything + } else { + updateSettings({ autoDownload: false }); + } + })(); }, [settings?.autoDownload]); /********************** *********************/ @@ -593,14 +584,6 @@ export const SettingToggles: React.FC = ({ ...props }) => { Optimized versions server - Set the URL for the optimized versions server for downloads. @@ -620,8 +603,7 @@ export const SettingToggles: React.FC = ({ ...props }) => {