fix: open google search for actor if Marlin turned off

This commit is contained in:
Fredrik Burmester
2024-08-21 20:37:50 +02:00
parent 874364fcde
commit a54da1c3dc

View File

@@ -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) => (
<TouchableOpacity
onPress={() => {
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"