mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-31 11:08:26 +01:00
chore: refactor
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { getPrimaryImage } from "@/utils/jellyfin";
|
||||
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
import React from "react";
|
||||
import { TouchableOpacity, View } from "react-native";
|
||||
@@ -7,6 +6,7 @@ import { Text } from "../common/Text";
|
||||
import Poster from "../Poster";
|
||||
import { useAtom } from "jotai";
|
||||
import { apiAtom } from "@/providers/JellyfinProvider";
|
||||
import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl";
|
||||
|
||||
export const CastAndCrew = ({ item }: { item: BaseItemDto }) => {
|
||||
const [api] = useAtom(apiAtom);
|
||||
@@ -17,7 +17,7 @@ export const CastAndCrew = ({ item }: { item: BaseItemDto }) => {
|
||||
data={item.People}
|
||||
renderItem={(item, index) => (
|
||||
<TouchableOpacity key={item.Id} className="flex flex-col w-32">
|
||||
<Poster item={item} url={getPrimaryImage({ api, item })} />
|
||||
<Poster item={item} url={getPrimaryImageUrl({ api, item })} />
|
||||
<Text className="mt-2">{item.Name}</Text>
|
||||
<Text className="text-xs opacity-50">{item.Role}</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { apiAtom } from "@/providers/JellyfinProvider";
|
||||
import { getPrimaryImage, getPrimaryImageById } from "@/utils/jellyfin";
|
||||
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
import { router } from "expo-router";
|
||||
import { useAtom } from "jotai";
|
||||
@@ -8,6 +7,7 @@ import { TouchableOpacity, View } from "react-native";
|
||||
import Poster from "../Poster";
|
||||
import { HorizontalScroll } from "../common/HorrizontalScroll";
|
||||
import { Text } from "../common/Text";
|
||||
import { getPrimaryImageUrlById } from "@/utils/jellyfin/image/getPrimaryImageUrlById";
|
||||
|
||||
export const CurrentSeries = ({ item }: { item: BaseItemDto }) => {
|
||||
const [api] = useAtom(apiAtom);
|
||||
@@ -25,7 +25,7 @@ export const CurrentSeries = ({ item }: { item: BaseItemDto }) => {
|
||||
>
|
||||
<Poster
|
||||
item={item}
|
||||
url={getPrimaryImageById({ api, id: item.ParentId })}
|
||||
url={getPrimaryImageUrlById({ api, id: item.ParentId })}
|
||||
/>
|
||||
<Text>{item.SeriesName}</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
Reference in New Issue
Block a user