diff --git a/src/navigation/AppNavigator.tsx b/src/navigation/AppNavigator.tsx index aaad6f6..8f1f1e6 100644 --- a/src/navigation/AppNavigator.tsx +++ b/src/navigation/AppNavigator.tsx @@ -59,6 +59,7 @@ export type RootStackParamList = { id: string; type: string; episodeId?: string; + episodeThumbnail?: string; }; VideoPlayer: { id: string; diff --git a/src/screens/MetadataScreen.tsx b/src/screens/MetadataScreen.tsx index a91fcc5..e771f00 100644 --- a/src/screens/MetadataScreen.tsx +++ b/src/screens/MetadataScreen.tsx @@ -222,8 +222,14 @@ const MetadataScreen: React.FC = () => { }, [navigation, id, type, episodes, episodeId, watchProgressData.watchProgress]); const handleEpisodeSelect = useCallback((episode: Episode) => { + console.log('[MetadataScreen] Selected Episode:', JSON.stringify(episode, null, 2)); const episodeId = episode.stremioId || `${id}:${episode.season_number}:${episode.episode_number}`; - navigation.navigate('Streams', { id, type, episodeId }); + navigation.navigate('Streams', { + id, + type, + episodeId, + episodeThumbnail: episode.still_path || undefined + }); }, [navigation, id, type]); const handleBack = useCallback(() => navigation.goBack(), [navigation]); diff --git a/src/screens/StreamsScreen.tsx b/src/screens/StreamsScreen.tsx index c2f723b..ea89852 100644 --- a/src/screens/StreamsScreen.tsx +++ b/src/screens/StreamsScreen.tsx @@ -232,7 +232,7 @@ const ProviderFilter = memo(({ export const StreamsScreen = () => { const route = useRoute>(); const navigation = useNavigation(); - const { id, type, episodeId } = route.params; + const { id, type, episodeId, episodeThumbnail } = route.params; const { settings } = useSettings(); const { currentTheme } = useTheme(); const { colors } = currentTheme; @@ -255,6 +255,10 @@ export const StreamsScreen = () => { } }, []); + useEffect(() => { + console.log('[StreamsScreen] Received thumbnail from params:', episodeThumbnail); + }, [episodeThumbnail]); + const { metadata, episodes, @@ -904,12 +908,21 @@ export const StreamsScreen = () => { }, [selectedProvider, type, episodeStreams, groupedStreams]); const episodeImage = useMemo(() => { + if (episodeThumbnail) { + if (episodeThumbnail.startsWith('http')) { + return episodeThumbnail; + } + return tmdbService.getImageUrl(episodeThumbnail, 'original'); + } if (!currentEpisode) return null; if (currentEpisode.still_path) { + if (currentEpisode.still_path.startsWith('http')) { + return currentEpisode.still_path; + } return tmdbService.getImageUrl(currentEpisode.still_path, 'original'); } return metadata?.poster || null; - }, [currentEpisode, metadata]); + }, [currentEpisode, metadata, episodeThumbnail]); const isLoading = type === 'series' ? loadingEpisodeStreams : loadingStreams; const streams = type === 'series' ? episodeStreams : groupedStreams;