mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-02 13:44:54 +00:00
TV Show stream fetching fixed
This commit is contained in:
parent
1f085604ee
commit
1f49de9b27
1 changed files with 11 additions and 10 deletions
|
|
@ -762,7 +762,8 @@ export const StreamsScreen = () => {
|
||||||
}, 500);
|
}, 500);
|
||||||
return () => clearTimeout(timer);
|
return () => clearTimeout(timer);
|
||||||
} else {
|
} else {
|
||||||
if (metadata?.videos && metadata.videos.length > 1 && episodeId) {
|
// For series episodes, do not wait for metadata; load directly when episodeId is present
|
||||||
|
if (episodeId) {
|
||||||
logger.log(`🎬 Loading episode streams for: ${episodeId}`);
|
logger.log(`🎬 Loading episode streams for: ${episodeId}`);
|
||||||
setLoadingProviders({
|
setLoadingProviders({
|
||||||
'stremio': true
|
'stremio': true
|
||||||
|
|
@ -776,15 +777,6 @@ export const StreamsScreen = () => {
|
||||||
setStreamsLoadStart(Date.now());
|
setStreamsLoadStart(Date.now());
|
||||||
if (__DEV__) console.log('[StreamsScreen] calling loadStreams (movie)', id);
|
if (__DEV__) console.log('[StreamsScreen] calling loadStreams (movie)', id);
|
||||||
loadStreams();
|
loadStreams();
|
||||||
} else if (metadata?.videos && metadata.videos.length > 1 && !episodeId) {
|
|
||||||
// Series with no episodes (e.g., TV/live channels) – fetch streams directly
|
|
||||||
logger.log(`🎬 Loading series streams (no episodes) for: ${id}`);
|
|
||||||
setLoadingProviders({
|
|
||||||
'stremio': true
|
|
||||||
});
|
|
||||||
setStreamsLoadStart(Date.now());
|
|
||||||
if (__DEV__) console.log('[StreamsScreen] calling loadStreams (series no episodeId)', id);
|
|
||||||
loadStreams();
|
|
||||||
} else if (type === 'tv') {
|
} else if (type === 'tv') {
|
||||||
// TV/live content – fetch streams directly
|
// TV/live content – fetch streams directly
|
||||||
logger.log(`📺 Loading TV streams for: ${id}`);
|
logger.log(`📺 Loading TV streams for: ${id}`);
|
||||||
|
|
@ -794,6 +786,15 @@ export const StreamsScreen = () => {
|
||||||
setStreamsLoadStart(Date.now());
|
setStreamsLoadStart(Date.now());
|
||||||
if (__DEV__) console.log('[StreamsScreen] calling loadStreams (tv)', id);
|
if (__DEV__) console.log('[StreamsScreen] calling loadStreams (tv)', id);
|
||||||
loadStreams();
|
loadStreams();
|
||||||
|
} else {
|
||||||
|
// Fallback: series without explicit episodeId (or other types) – fetch streams directly
|
||||||
|
logger.log(`🎬 Loading streams for: ${id}`);
|
||||||
|
setLoadingProviders({
|
||||||
|
'stremio': true
|
||||||
|
});
|
||||||
|
setStreamsLoadStart(Date.now());
|
||||||
|
if (__DEV__) console.log('[StreamsScreen] calling loadStreams (fallback)', id);
|
||||||
|
loadStreams();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset autoplay state when content changes
|
// Reset autoplay state when content changes
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue