mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-06 05:58:35 +01:00
Compare commits
1 Commits
develop
...
fix/series
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3808bc196 |
@@ -3,6 +3,7 @@ import { FlashList } from "@shopify/flash-list";
|
|||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import type React from "react";
|
import type React from "react";
|
||||||
|
import { useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
import { apiAtom, userAtom } from "@/providers/JellyfinProvider";
|
import { apiAtom, userAtom } from "@/providers/JellyfinProvider";
|
||||||
@@ -33,13 +34,16 @@ export const NextUp: React.FC<{ seriesId: string }> = ({ seriesId }) => {
|
|||||||
staleTime: 0,
|
staleTime: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!items?.length)
|
// Defensive client-side filter: some Jellyfin server versions ignore the
|
||||||
return (
|
// `seriesId` query param on /Shows/NextUp and return next-up items across all
|
||||||
<View className='px-4'>
|
// series (the same content as the home tab's Next Up row). Filter to ensure
|
||||||
<Text className='text-lg font-bold mb-2'>{t("item_card.next_up")}</Text>
|
// we only ever show episodes belonging to this series.
|
||||||
<Text className='opacity-50'>{t("item_card.no_items_to_display")}</Text>
|
const filteredItems = useMemo(
|
||||||
</View>
|
() => items?.filter((item) => item.SeriesId === seriesId) ?? [],
|
||||||
);
|
[items, seriesId],
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!filteredItems.length) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
@@ -50,7 +54,7 @@ export const NextUp: React.FC<{ seriesId: string }> = ({ seriesId }) => {
|
|||||||
contentContainerStyle={{ paddingLeft: 16 }}
|
contentContainerStyle={{ paddingLeft: 16 }}
|
||||||
horizontal
|
horizontal
|
||||||
showsHorizontalScrollIndicator={false}
|
showsHorizontalScrollIndicator={false}
|
||||||
data={items}
|
data={filteredItems}
|
||||||
renderItem={({ item, index }) => (
|
renderItem={({ item, index }) => (
|
||||||
<TouchableItemRouter
|
<TouchableItemRouter
|
||||||
item={item}
|
item={item}
|
||||||
|
|||||||
Reference in New Issue
Block a user