This commit is contained in:
Fredrik Burmester
2024-08-20 08:26:02 +02:00
parent 9bbab4f46f
commit 4873aaf3df
3 changed files with 8 additions and 18 deletions

View File

@@ -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();

View File

@@ -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<typeof Button> {
item?: BaseItemDto | null;

View File

@@ -56,13 +56,6 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({
const [jellyfin, setJellyfin] = useState<Jellyfin | undefined>(undefined);
const [deviceId, setDeviceId] = useState<string | undefined>(undefined);
const [isConnected, setIsConnected] = useState<boolean>(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);
}
};