diff --git a/src/components/home/ContinueWatchingSection.tsx b/src/components/home/ContinueWatchingSection.tsx index a9af8ac2..0a0beaa5 100644 --- a/src/components/home/ContinueWatchingSection.tsx +++ b/src/components/home/ContinueWatchingSection.tsx @@ -729,7 +729,7 @@ const ContinueWatchingSection = React.forwardRef((props, re id: item.id, type: item.type, episodeId: episodeId, - imdbId: cachedStream.metadata?.imdbId || item.imdb_id, + imdbId: cachedStream.imdbId || cachedStream.metadata?.imdbId || item.imdb_id, backdrop: cachedStream.metadata?.backdrop || item.banner, videoType: undefined, // Let player auto-detect } as any); diff --git a/src/screens/StreamsScreen.tsx b/src/screens/StreamsScreen.tsx index 582566d9..b76c1a57 100644 --- a/src/screens/StreamsScreen.tsx +++ b/src/screens/StreamsScreen.tsx @@ -1150,7 +1150,8 @@ export const StreamsScreen = () => { episodeId, season, episode, - episodeTitle + episodeTitle, + imdbId || undefined ); } catch (error) { logger.warn('[StreamsScreen] Failed to save stream to cache:', error); diff --git a/src/services/streamCacheService.ts b/src/services/streamCacheService.ts index be658be3..ee59edb2 100644 --- a/src/services/streamCacheService.ts +++ b/src/services/streamCacheService.ts @@ -8,6 +8,7 @@ export interface CachedStream { season?: number; episode?: number; episodeTitle?: string; + imdbId?: string; // IMDb ID for subtitle fetching timestamp: number; // When it was cached url: string; // Stream URL for quick validation } @@ -32,7 +33,8 @@ class StreamCacheService { episodeId?: string, season?: number, episode?: number, - episodeTitle?: string + episodeTitle?: string, + imdbId?: string ): Promise { try { const cacheKey = this.getCacheKey(id, type, episodeId); @@ -45,6 +47,7 @@ class StreamCacheService { season, episode, episodeTitle, + imdbId, timestamp: now, url: stream.url };