mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-20 16:22:04 +00:00
Merge pull request #656 from chrisk325/patch-24
This commit is contained in:
commit
5f49a7f2ab
1 changed files with 16 additions and 11 deletions
|
|
@ -189,6 +189,11 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
|
|
||||||
const metadataResult = useMetadata({ id: id || 'placeholder', type: (type as any) });
|
const metadataResult = useMetadata({ id: id || 'placeholder', type: (type as any) });
|
||||||
const { metadata, cast } = Boolean(id && type) ? (metadataResult as any) : { metadata: null, cast: [] };
|
const { metadata, cast } = Boolean(id && type) ? (metadataResult as any) : { metadata: null, cast: [] };
|
||||||
|
|
||||||
|
// For content with provider IDs (e.g. kitsu:123), imdbId from route params may be null at
|
||||||
|
// navigation time. useMetadata resolves it asynchronously via ARM + TMDB. Use that resolved
|
||||||
|
// value as a fallback so Trakt scrobbling and watched status use a real IMDb ID.
|
||||||
|
const resolvedImdbId: string | undefined = imdbId || (metadataResult as any).imdbId || undefined;
|
||||||
const hasLogo = metadata && metadata.logo;
|
const hasLogo = metadata && metadata.logo;
|
||||||
const openingAnimation = useOpeningAnimation(backdrop, metadata);
|
const openingAnimation = useOpeningAnimation(backdrop, metadata);
|
||||||
|
|
||||||
|
|
@ -212,12 +217,12 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
type: type === 'series' ? 'series' : 'movie',
|
type: type === 'series' ? 'series' : 'movie',
|
||||||
title: episodeTitle || title,
|
title: episodeTitle || title,
|
||||||
year: year || 0,
|
year: year || 0,
|
||||||
imdbId: imdbId || '',
|
imdbId: resolvedImdbId || '',
|
||||||
season: season,
|
season: season,
|
||||||
episode: episode,
|
episode: episode,
|
||||||
showTitle: title,
|
showTitle: title,
|
||||||
showYear: year,
|
showYear: year,
|
||||||
showImdbId: imdbId,
|
showImdbId: resolvedImdbId,
|
||||||
episodeId: episodeId
|
episodeId: episodeId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -244,7 +249,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
traktAutosync,
|
traktAutosync,
|
||||||
controlsHook.seekToTime,
|
controlsHook.seekToTime,
|
||||||
currentStreamProvider,
|
currentStreamProvider,
|
||||||
imdbId,
|
resolvedImdbId,
|
||||||
season,
|
season,
|
||||||
episode,
|
episode,
|
||||||
releaseDate,
|
releaseDate,
|
||||||
|
|
@ -267,7 +272,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
const nextEpisodeHook = useNextEpisode(type, season, episode, groupedEpisodes, (metadataResult as any)?.groupedEpisodes, episodeId);
|
const nextEpisodeHook = useNextEpisode(type, season, episode, groupedEpisodes, (metadataResult as any)?.groupedEpisodes, episodeId);
|
||||||
|
|
||||||
const { segments: skipIntervals, outroSegment } = useSkipSegments({
|
const { segments: skipIntervals, outroSegment } = useSkipSegments({
|
||||||
imdbId: imdbId || (id?.startsWith('tt') ? id : undefined),
|
imdbId: resolvedImdbId || (id?.startsWith('tt') ? id : undefined),
|
||||||
type,
|
type,
|
||||||
season,
|
season,
|
||||||
episode,
|
episode,
|
||||||
|
|
@ -731,7 +736,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
id,
|
id,
|
||||||
type: 'series',
|
type: 'series',
|
||||||
episodeId: ep.stremioId || `${id}:${ep.season_number}:${ep.episode_number}`,
|
episodeId: ep.stremioId || `${id}:${ep.season_number}:${ep.episode_number}`,
|
||||||
imdbId: imdbId ?? undefined,
|
imdbId: resolvedImdbId ?? undefined,
|
||||||
backdrop: backdrop || undefined,
|
backdrop: backdrop || undefined,
|
||||||
availableStreams: {},
|
availableStreams: {},
|
||||||
groupedEpisodes: groupedEpisodes,
|
groupedEpisodes: groupedEpisodes,
|
||||||
|
|
@ -741,7 +746,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
|
|
||||||
// Subtitle addon fetching
|
// Subtitle addon fetching
|
||||||
const fetchAvailableSubtitles = useCallback(async () => {
|
const fetchAvailableSubtitles = useCallback(async () => {
|
||||||
const targetImdbId = imdbId;
|
const targetImdbId = resolvedImdbId;
|
||||||
|
|
||||||
setIsLoadingSubtitleList(true);
|
setIsLoadingSubtitleList(true);
|
||||||
try {
|
try {
|
||||||
|
|
@ -820,7 +825,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoadingSubtitleList(false);
|
setIsLoadingSubtitleList(false);
|
||||||
}
|
}
|
||||||
}, [imdbId, type, season, episode, id]);
|
}, [resolvedImdbId, type, season, episode, id]);
|
||||||
|
|
||||||
const loadWyzieSubtitle = useCallback(async (subtitle: WyzieSubtitle) => {
|
const loadWyzieSubtitle = useCallback(async (subtitle: WyzieSubtitle) => {
|
||||||
if (!subtitle.url) return;
|
if (!subtitle.url) return;
|
||||||
|
|
@ -1122,7 +1127,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
canEnterPictureInPicture={canShowPipButton}
|
canEnterPictureInPicture={canShowPipButton}
|
||||||
onEnterPictureInPicture={handleEnterPictureInPicture}
|
onEnterPictureInPicture={handleEnterPictureInPicture}
|
||||||
isBuffering={playerState.isBuffering}
|
isBuffering={playerState.isBuffering}
|
||||||
imdbId={imdbId}
|
imdbId={resolvedImdbId}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SpeedActivatedOverlay
|
<SpeedActivatedOverlay
|
||||||
|
|
@ -1148,7 +1153,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
|
|
||||||
{/* Parental Guide Overlay - Shows after controls first hide */}
|
{/* Parental Guide Overlay - Shows after controls first hide */}
|
||||||
<ParentalGuideOverlay
|
<ParentalGuideOverlay
|
||||||
imdbId={imdbId || (id?.startsWith('tt') ? id : undefined)}
|
imdbId={resolvedImdbId || (id?.startsWith('tt') ? id : undefined)}
|
||||||
type={type as 'movie' | 'series'}
|
type={type as 'movie' | 'series'}
|
||||||
season={season}
|
season={season}
|
||||||
episode={episode}
|
episode={episode}
|
||||||
|
|
@ -1157,7 +1162,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
|
|
||||||
{/* Skip Intro Button - Shows during intro section of TV episodes */}
|
{/* Skip Intro Button - Shows during intro section of TV episodes */}
|
||||||
<SkipIntroButton
|
<SkipIntroButton
|
||||||
imdbId={imdbId || (id?.startsWith('tt') ? id : undefined)}
|
imdbId={resolvedImdbId || (id?.startsWith('tt') ? id : undefined)}
|
||||||
type={type || 'movie'}
|
type={type || 'movie'}
|
||||||
season={season}
|
season={season}
|
||||||
episode={episode}
|
episode={episode}
|
||||||
|
|
@ -1304,7 +1309,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
visible={modals.showSubmitIntroModal}
|
visible={modals.showSubmitIntroModal}
|
||||||
onClose={() => modals.setShowSubmitIntroModal(false)}
|
onClose={() => modals.setShowSubmitIntroModal(false)}
|
||||||
currentTime={playerState.currentTime}
|
currentTime={playerState.currentTime}
|
||||||
imdbId={imdbId}
|
imdbId={resolvedImdbId}
|
||||||
season={season}
|
season={season}
|
||||||
episode={episode}
|
episode={episode}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue