diff --git a/app/(auth)/(tabs)/(home,libraries,search)/livetv/programs.tsx b/app/(auth)/(tabs)/(home,libraries,search)/livetv/programs.tsx index 27ed4385..00c1235a 100644 --- a/app/(auth)/(tabs)/(home,libraries,search)/livetv/programs.tsx +++ b/app/(auth)/(tabs)/(home,libraries,search)/livetv/programs.tsx @@ -1,17 +1,13 @@ -import { Text } from "@/components/common/Text"; import { ScrollingCollectionList } from "@/components/home/ScrollingCollectionList"; import { TAB_HEIGHT } from "@/constants/Values"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { getLiveTvApi } from "@jellyfin/sdk/lib/utils/api"; -import { useQuery } from "@tanstack/react-query"; import { useAtom } from "jotai"; import React from "react"; import { - RefreshControl, ScrollView, - SectionListComponent, - View, + View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; diff --git a/app/(auth)/(tabs)/(home,libraries,search)/livetv/recordings.tsx b/app/(auth)/(tabs)/(home,libraries,search)/livetv/recordings.tsx index 9bbae531..6e3f660e 100644 --- a/app/(auth)/(tabs)/(home,libraries,search)/livetv/recordings.tsx +++ b/app/(auth)/(tabs)/(home,libraries,search)/livetv/recordings.tsx @@ -4,8 +4,8 @@ import { View } from "react-native"; export default function page() { return ( - - Not implemented + + Coming soon ); } diff --git a/bun.lockb b/bun.lockb index 133145f0..85cc964e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/ContinueWatchingPoster.tsx b/components/ContinueWatchingPoster.tsx index 46d01371..3a1899ec 100644 --- a/components/ContinueWatchingPoster.tsx +++ b/components/ContinueWatchingPoster.tsx @@ -48,9 +48,18 @@ const ContinueWatchingPoster: React.FC = ({ } }, [item]); - const [progress, setProgress] = useState( - item.UserData?.PlayedPercentage || 0 - ); + const progress = useMemo(() => { + if (item.Type === "Program") { + const startDate = new Date(item.StartDate || ""); + const endDate = new Date(item.EndDate || ""); + const now = new Date(); + const total = endDate.getTime() - startDate.getTime(); + const elapsed = now.getTime() - startDate.getTime(); + return (elapsed / total) * 100; + } else { + return item.UserData?.PlayedPercentage || 0; + } + }, []); if (!url) return ( diff --git a/components/ItemContent.tsx b/components/ItemContent.tsx index e9d8a004..1634be65 100644 --- a/components/ItemContent.tsx +++ b/components/ItemContent.tsx @@ -248,8 +248,8 @@ export const ItemContent: React.FC<{ item: BaseItemDto }> = React.memo( > - - + + {item.Type !== "Program" && ( = React.memo( )} - + )} @@ -288,28 +288,31 @@ export const ItemContent: React.FC<{ item: BaseItemDto }> = React.memo( )} + {item.Type !== "Program" && ( + <> + - + {item.People && item.People.length > 0 && ( + + {item.People.slice(0, 3).map((person) => ( + + ))} + + )} - {item.People && item.People.length > 0 && ( - - {item.People.slice(0, 3).map((person) => ( - - ))} - + {item.Type === "Episode" && ( + + )} + + + )} - {item.Type === "Episode" && ( - - )} - - - diff --git a/components/livetv/HourHeader.tsx b/components/livetv/HourHeader.tsx index 00a51d9e..99344e43 100644 --- a/components/livetv/HourHeader.tsx +++ b/components/livetv/HourHeader.tsx @@ -23,7 +23,7 @@ export const HourHeader = ({ height }: { height: number }) => { }; const HourCell = ({ hour }: { hour: Date }) => ( - + {hour.toLocaleTimeString([], { hour: "2-digit", diff --git a/components/livetv/LiveTVGuideRow.tsx b/components/livetv/LiveTVGuideRow.tsx index 96c58481..cbb70d19 100644 --- a/components/livetv/LiveTVGuideRow.tsx +++ b/components/livetv/LiveTVGuideRow.tsx @@ -8,10 +8,12 @@ export const LiveTVGuideRow = ({ channel, programs, scrollX = 0, + isVisible = true, }: { channel: BaseItemDto; programs?: BaseItemDto[] | null; scrollX?: number; + isVisible?: boolean; }) => { const positionRefs = useRef<{ [key: string]: number }>({}); const screenWidth = Dimensions.get("window").width; @@ -46,6 +48,10 @@ export const LiveTVGuideRow = ({ return now >= start && now <= end; }; + if (!isVisible) { + return ; + } + return ( {programsWithPositions?.map((p) => ( diff --git a/package.json b/package.json index 8d2bb311..f134386a 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@config-plugins/ffmpeg-kit-react-native": "^8.0.0", "@expo/react-native-action-sheet": "^4.1.0", "@expo/vector-icons": "^14.0.3", + "@futurejj/react-native-visibility-sensor": "^1.3.4", "@gorhom/bottom-sheet": "^4", "@jellyfin/sdk": "^0.10.0", "@kesha-antonov/react-native-background-downloader": "^3.2.1",