From 4873aaf3df972727e0d38971ef22c5da8d771c74 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Tue, 20 Aug 2024 08:26:02 +0200 Subject: [PATCH] chore --- app/(auth)/items/[id].tsx | 12 ++++++------ components/PlayButton.tsx | 4 ++-- providers/JellyfinProvider.tsx | 10 ---------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/app/(auth)/items/[id].tsx b/app/(auth)/items/[id].tsx index 86b88913..373110e5 100644 --- a/app/(auth)/items/[id].tsx +++ b/app/(auth)/items/[id].tsx @@ -15,6 +15,12 @@ import { CurrentSeries } from "@/components/series/CurrentSeries"; import { NextEpisodeButton } from "@/components/series/NextEpisodeButton"; import { SeriesTitleHeader } from "@/components/series/SeriesTitleHeader"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { + currentlyPlayingItemAtom, + fullScreenAtom, + playingAtom, + showCurrentlyPlayingBarAtom, +} from "@/utils/atoms/playState"; import { useSettings } from "@/utils/atoms/settings"; import { getBackdropUrl } from "@/utils/jellyfin/image/getBackdropUrl"; import { getLogoImageUrlById } from "@/utils/jellyfin/image/getLogoImageUrlById"; @@ -37,12 +43,6 @@ import CastContext, { useRemoteMediaClient, } from "react-native-google-cast"; import { ParallaxScrollView } from "../../../components/ParallaxPage"; -import { - currentlyPlayingItemAtom, - fullScreenAtom, - playingAtom, - showCurrentlyPlayingBarAtom, -} from "@/utils/atoms/playState"; const page: React.FC = () => { const local = useLocalSearchParams(); diff --git a/components/PlayButton.tsx b/components/PlayButton.tsx index e2dac181..3a6263ee 100644 --- a/components/PlayButton.tsx +++ b/components/PlayButton.tsx @@ -1,14 +1,14 @@ +import { usePlayback } from "@/providers/PlaybackProvider"; import { runtimeTicksToMinutes } from "@/utils/time"; import { useActionSheet } from "@expo/react-native-action-sheet"; import { Feather, Ionicons } from "@expo/vector-icons"; import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { View } from "react-native"; -import { Button } from "./Button"; import CastContext, { PlayServicesState, useRemoteMediaClient, } from "react-native-google-cast"; -import { usePlayback } from "@/providers/PlaybackProvider"; +import { Button } from "./Button"; interface Props extends React.ComponentProps { item?: BaseItemDto | null; diff --git a/providers/JellyfinProvider.tsx b/providers/JellyfinProvider.tsx index 896edff6..b885035b 100644 --- a/providers/JellyfinProvider.tsx +++ b/providers/JellyfinProvider.tsx @@ -56,13 +56,6 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({ const [jellyfin, setJellyfin] = useState(undefined); const [deviceId, setDeviceId] = useState(undefined); const [isConnected, setIsConnected] = useState(false); - const [playing, setPlaying] = useAtom(playingAtom); - const [currentlyPlaying, setCurrentlyPlaying] = useAtom( - currentlyPlayingItemAtom - ); - const [showCurrentlyPlayingBar, setShowCurrentlyPlayingBar] = useAtom( - showCurrentlyPlayingBarAtom - ); useEffect(() => { (async () => { @@ -115,11 +108,8 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({ // On PlayPause if (command === "PlayPause") { console.log("Command ~ PlayPause"); - setPlaying((state) => !state); } else if (command === "Stop") { console.log("Command ~ Stop"); - setPlaying(false); - setShowCurrentlyPlayingBar(false); } };