Add IMDb ID support to navigation and video player components

This update introduces the optional IMDb ID parameter to the navigation types and the VideoPlayer component, enhancing subtitle fetching capabilities. The StreamsScreen has been updated to utilize the new IMDb ID, ensuring that external subtitles can be automatically searched based on the provided ID. These changes improve the overall functionality and user experience when accessing video content.
This commit is contained in:
tapframe 2025-06-08 18:29:17 +05:30
parent 0d2b33a995
commit 10e12fa6bd
4 changed files with 1214 additions and 118 deletions

View file

@ -77,6 +77,7 @@ export type RootStackParamList = {
id?: string;
type?: string;
episodeId?: string;
imdbId?: string;
};
Catalog: { id: string; type: string; addonId?: string; name?: string; genreFilter?: string };
Credits: { mediaId: string; mediaType: string };

View file

@ -270,6 +270,7 @@ export const StreamsScreen = () => {
loadEpisodeStreams,
setSelectedEpisode,
groupedEpisodes,
imdbId,
} = useMetadata({ id, type });
// Create styles using current theme colors
@ -526,7 +527,8 @@ export const StreamsScreen = () => {
streamProvider: stream.name,
id,
type,
episodeId: type === 'series' && selectedEpisode ? selectedEpisode : undefined
episodeId: type === 'series' && selectedEpisode ? selectedEpisode : undefined,
imdbId: imdbId || undefined,
});
} catch (error) {
logger.error('[StreamsScreen] Error locking orientation before navigation:', error);
@ -542,10 +544,11 @@ export const StreamsScreen = () => {
streamProvider: stream.name,
id,
type,
episodeId: type === 'series' && selectedEpisode ? selectedEpisode : undefined
episodeId: type === 'series' && selectedEpisode ? selectedEpisode : undefined,
imdbId: imdbId || undefined,
});
}
}, [metadata, type, currentEpisode, navigation, id, selectedEpisode]);
}, [metadata, type, currentEpisode, navigation, id, selectedEpisode, imdbId]);
// Update handleStreamPress
const handleStreamPress = useCallback(async (stream: Stream) => {

File diff suppressed because it is too large Load diff

View file

@ -27,6 +27,7 @@ export type RootStackParamList = {
url: string;
lang: string;
}>;
imdbId?: string;
};
Catalog: {
addonId?: string;