From 13523fbbe45b00a742babd2d5a26838e628f371e Mon Sep 17 00:00:00 2001 From: tapframe Date: Sun, 16 Nov 2025 17:55:38 +0530 Subject: [PATCH] trakt episode marking bug fix --- src/components/TabletStreamsLayout.tsx | 23 ++++++++++++++++++----- src/components/metadata/SeriesContent.tsx | 15 +++++++++++++-- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/components/TabletStreamsLayout.tsx b/src/components/TabletStreamsLayout.tsx index 9645624..16fe57e 100644 --- a/src/components/TabletStreamsLayout.tsx +++ b/src/components/TabletStreamsLayout.tsx @@ -289,7 +289,7 @@ const TabletStreamsLayout: React.FC = ({ } if (streamsEmpty) { - if (showInitialLoading || showStillFetching) { + if (showInitialLoading || showStillFetching || isAutoplayWaiting) { return ( @@ -411,7 +411,7 @@ const TabletStreamsLayout: React.FC = ({ {/* Left Panel: Movie Logo/Episode Info */} - {type === 'movie' && metadata && ( + {type === 'movie' && metadata ? ( {metadata.logo && !movieLogoError ? ( = ({ {metadata.name} )} - )} - - {type === 'series' && currentEpisode && ( + ) : type === 'series' && currentEpisode ? ( {currentEpisode.episodeString} {currentEpisode.name} @@ -434,6 +432,10 @@ const TabletStreamsLayout: React.FC = ({ {currentEpisode.overview} )} + ) : ( + + No content information available + )} @@ -769,6 +771,17 @@ const createStyles = (colors: any) => StyleSheet.create({ lineHeight: 24, opacity: 0.95, }, + tabletEmptyLeftPanel: { + justifyContent: 'center', + alignItems: 'center', + width: '100%', + height: '100%', + }, + tabletEmptyLeftPanelText: { + color: colors.mediumEmphasis, + fontSize: 16, + fontStyle: 'italic', + }, tabletRightPanel: { width: '60%', flex: 1, diff --git a/src/components/metadata/SeriesContent.tsx b/src/components/metadata/SeriesContent.tsx index bd09eee..c790a16 100644 --- a/src/components/metadata/SeriesContent.tsx +++ b/src/components/metadata/SeriesContent.tsx @@ -250,9 +250,20 @@ const SeriesContentComponent: React.FC = ({ const traktService = TraktService.getInstance(); const isAuthed = await traktService.isAuthenticated(); if (isAuthed && metadata?.id) { - const historyItems = await traktService.getWatchedEpisodesHistory(1, 400); + // Fetch multiple pages to ensure we get all episodes for shows with many seasons + // Each page has up to 100 items by default, fetch enough to cover ~12+ seasons + let allHistoryItems: any[] = []; + const pageLimit = 10; // Fetch up to 10 pages (max 1000 items) to cover extensive libraries + + for (let page = 1; page <= pageLimit; page++) { + const historyItems = await traktService.getWatchedEpisodesHistory(page, 100); + if (!historyItems || historyItems.length === 0) { + break; // No more items to fetch + } + allHistoryItems = allHistoryItems.concat(historyItems); + } - historyItems.forEach(item => { + allHistoryItems.forEach(item => { if (item.type !== 'episode') return; const showImdb = item.show?.ids?.imdb ? `tt${item.show.ids.imdb.replace(/^tt/, '')}` : null;