From a54da1c3dc31bd0a9121763524ab465ea030589e Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Wed, 21 Aug 2024 20:37:50 +0200 Subject: [PATCH] fix: open google search for actor if Marlin turned off --- components/series/CastAndCrew.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/series/CastAndCrew.tsx b/components/series/CastAndCrew.tsx index 6dcdaccd..2de035fb 100644 --- a/components/series/CastAndCrew.tsx +++ b/components/series/CastAndCrew.tsx @@ -11,10 +11,13 @@ import { useAtom } from "jotai"; import { apiAtom } from "@/providers/JellyfinProvider"; import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; import { router, usePathname } from "expo-router"; +import { useSettings } from "@/utils/atoms/settings"; export const CastAndCrew = ({ item }: { item: BaseItemDto }) => { const [api] = useAtom(apiAtom); + const [settings] = useSettings(); + const pathname = usePathname(); return ( @@ -25,7 +28,10 @@ export const CastAndCrew = ({ item }: { item: BaseItemDto }) => { renderItem={(item, index) => ( { - router.push(`/search?q=${item.Name}&prev=${pathname}`); + if (settings?.searchEngine === "Marlin") + router.push(`/search?q=${item.Name}&prev=${pathname}`); + else + Linking.openURL(`https://www.google.com/search?q=${item.Name}`); }} key={item.Id} className="flex flex-col w-32"