fixed subtitle not fetching on cahced strream link

This commit is contained in:
tapframe 2025-10-21 22:17:42 +05:30
parent c852c56231
commit 2a4c076854
3 changed files with 7 additions and 3 deletions

View file

@ -729,7 +729,7 @@ const ContinueWatchingSection = React.forwardRef<ContinueWatchingRef>((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);

View file

@ -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);

View file

@ -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<void> {
try {
const cacheKey = this.getCacheKey(id, type, episodeId);
@ -45,6 +47,7 @@ class StreamCacheService {
season,
episode,
episodeTitle,
imdbId,
timestamp: now,
url: stream.url
};