fix: refactor

This commit is contained in:
Fredrik Burmester
2024-08-17 13:14:59 +02:00
parent 26050f7179
commit 6bfc0c72d1
9 changed files with 59 additions and 57 deletions

View File

@@ -173,7 +173,6 @@ export const CurrentlyPlayingBar: React.FC = () => {
}, [playing, progress, item, sessionData]);
useEffect(() => {
console.log("Full screen changed", fullScreen);
if (fullScreen === true) {
videoRef.current?.presentFullscreenPlayer();
} else {

View File

@@ -36,7 +36,7 @@ export const ItemCardText: React.FC<ItemCardProps> = ({ item }) => {
</>
) : (
<>
<Text>{item.Name}</Text>
<Text numberOfLines={2}>{item.Name}</Text>
<Text className="text-xs opacity-50">{item.ProductionYear}</Text>
</>
)}

View File

@@ -53,6 +53,7 @@ const MoviePoster: React.FC<MoviePosterProps> = ({
contentFit="cover"
style={{
aspectRatio: "10/15",
width: "100%",
}}
/>
<WatchedIndicator item={item} />

View File

@@ -37,11 +37,7 @@ export const SubtitleTrackSelector: React.FC<Props> = ({
if (index !== undefined && index !== null) {
onChange(index);
} else {
// Get first subtitle stream
const firstSubtitle = subtitleStreams.find((x) => x.Index !== undefined);
if (firstSubtitle?.Index !== undefined) {
onChange(firstSubtitle.Index);
}
onChange(-1);
}
}, []);
@@ -56,7 +52,9 @@ export const SubtitleTrackSelector: React.FC<Props> = ({
<View className="flex flex-row">
<TouchableOpacity className="bg-neutral-900 max-w-32 h-12 rounded-2xl border-neutral-900 border px-3 py-2 flex flex-row items-center justify-between">
<Text className="">
{tc(selectedSubtitleSteam?.DisplayTitle, 13)}
{selectedSubtitleSteam
? tc(selectedSubtitleSteam?.DisplayTitle, 13)
: "None"}
</Text>
</TouchableOpacity>
</View>
@@ -72,6 +70,14 @@ export const SubtitleTrackSelector: React.FC<Props> = ({
sideOffset={8}
>
<DropdownMenu.Label>Subtitles</DropdownMenu.Label>
<DropdownMenu.Item
key={"-1"}
onSelect={() => {
onChange(-1);
}}
>
<DropdownMenu.ItemTitle>None</DropdownMenu.ItemTitle>
</DropdownMenu.Item>
{subtitleStreams?.map((subtitle, idx: number) => (
<DropdownMenu.Item
key={idx.toString()}