Skip to content

Commit 13523fb

Browse files
committed
trakt episode marking bug fix
1 parent e9b38db commit 13523fb

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

src/components/TabletStreamsLayout.tsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const TabletStreamsLayout: React.FC<TabletStreamsLayoutProps> = ({
289289
}
290290

291291
if (streamsEmpty) {
292-
if (showInitialLoading || showStillFetching) {
292+
if (showInitialLoading || showStillFetching || isAutoplayWaiting) {
293293
return (
294294
<View style={[styles.loadingContainer, { paddingTop: 50 }]}>
295295
<ActivityIndicator size="large" color={colors.primary} />
@@ -411,7 +411,7 @@ const TabletStreamsLayout: React.FC<TabletStreamsLayoutProps> = ({
411411

412412
{/* Left Panel: Movie Logo/Episode Info */}
413413
<Animated.View style={[styles.tabletLeftPanel, leftPanelAnimatedStyle]}>
414-
{type === 'movie' && metadata && (
414+
{type === 'movie' && metadata ? (
415415
<View style={styles.tabletMovieLogoContainer}>
416416
{metadata.logo && !movieLogoError ? (
417417
<FastImage
@@ -424,16 +424,18 @@ const TabletStreamsLayout: React.FC<TabletStreamsLayoutProps> = ({
424424
<Text style={styles.tabletMovieTitle}>{metadata.name}</Text>
425425
)}
426426
</View>
427-
)}
428-
429-
{type === 'series' && currentEpisode && (
427+
) : type === 'series' && currentEpisode ? (
430428
<View style={styles.tabletEpisodeInfo}>
431429
<Text style={[styles.streamsHeroEpisodeNumber, styles.tabletEpisodeText, styles.tabletEpisodeNumber]}>{currentEpisode.episodeString}</Text>
432430
<Text style={[styles.streamsHeroTitle, styles.tabletEpisodeText, styles.tabletEpisodeTitle]} numberOfLines={2}>{currentEpisode.name}</Text>
433431
{currentEpisode.overview && (
434432
<Text style={[styles.streamsHeroOverview, styles.tabletEpisodeText, styles.tabletEpisodeOverview]} numberOfLines={4}>{currentEpisode.overview}</Text>
435433
)}
436434
</View>
435+
) : (
436+
<View style={styles.tabletEmptyLeftPanel}>
437+
<Text style={styles.tabletEmptyLeftPanelText}>No content information available</Text>
438+
</View>
437439
)}
438440
</Animated.View>
439441

@@ -769,6 +771,17 @@ const createStyles = (colors: any) => StyleSheet.create({
769771
lineHeight: 24,
770772
opacity: 0.95,
771773
},
774+
tabletEmptyLeftPanel: {
775+
justifyContent: 'center',
776+
alignItems: 'center',
777+
width: '100%',
778+
height: '100%',
779+
},
780+
tabletEmptyLeftPanelText: {
781+
color: colors.mediumEmphasis,
782+
fontSize: 16,
783+
fontStyle: 'italic',
784+
},
772785
tabletRightPanel: {
773786
width: '60%',
774787
flex: 1,

src/components/metadata/SeriesContent.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,20 @@ const SeriesContentComponent: React.FC<SeriesContentProps> = ({
250250
const traktService = TraktService.getInstance();
251251
const isAuthed = await traktService.isAuthenticated();
252252
if (isAuthed && metadata?.id) {
253-
const historyItems = await traktService.getWatchedEpisodesHistory(1, 400);
253+
// Fetch multiple pages to ensure we get all episodes for shows with many seasons
254+
// Each page has up to 100 items by default, fetch enough to cover ~12+ seasons
255+
let allHistoryItems: any[] = [];
256+
const pageLimit = 10; // Fetch up to 10 pages (max 1000 items) to cover extensive libraries
257+
258+
for (let page = 1; page <= pageLimit; page++) {
259+
const historyItems = await traktService.getWatchedEpisodesHistory(page, 100);
260+
if (!historyItems || historyItems.length === 0) {
261+
break; // No more items to fetch
262+
}
263+
allHistoryItems = allHistoryItems.concat(historyItems);
264+
}
254265

255-
historyItems.forEach(item => {
266+
allHistoryItems.forEach(item => {
256267
if (item.type !== 'episode') return;
257268

258269
const showImdb = item.show?.ids?.imdb ? `tt${item.show.ids.imdb.replace(/^tt/, '')}` : null;

0 commit comments

Comments
 (0)