mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-22 01:01:56 +00:00
trakt episode marking bug fix
This commit is contained in:
parent
e9b38db8b4
commit
13523fbbe4
2 changed files with 31 additions and 7 deletions
|
|
@ -289,7 +289,7 @@ const TabletStreamsLayout: React.FC<TabletStreamsLayoutProps> = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (streamsEmpty) {
|
if (streamsEmpty) {
|
||||||
if (showInitialLoading || showStillFetching) {
|
if (showInitialLoading || showStillFetching || isAutoplayWaiting) {
|
||||||
return (
|
return (
|
||||||
<View style={[styles.loadingContainer, { paddingTop: 50 }]}>
|
<View style={[styles.loadingContainer, { paddingTop: 50 }]}>
|
||||||
<ActivityIndicator size="large" color={colors.primary} />
|
<ActivityIndicator size="large" color={colors.primary} />
|
||||||
|
|
@ -411,7 +411,7 @@ const TabletStreamsLayout: React.FC<TabletStreamsLayoutProps> = ({
|
||||||
|
|
||||||
{/* Left Panel: Movie Logo/Episode Info */}
|
{/* Left Panel: Movie Logo/Episode Info */}
|
||||||
<Animated.View style={[styles.tabletLeftPanel, leftPanelAnimatedStyle]}>
|
<Animated.View style={[styles.tabletLeftPanel, leftPanelAnimatedStyle]}>
|
||||||
{type === 'movie' && metadata && (
|
{type === 'movie' && metadata ? (
|
||||||
<View style={styles.tabletMovieLogoContainer}>
|
<View style={styles.tabletMovieLogoContainer}>
|
||||||
{metadata.logo && !movieLogoError ? (
|
{metadata.logo && !movieLogoError ? (
|
||||||
<FastImage
|
<FastImage
|
||||||
|
|
@ -424,9 +424,7 @@ const TabletStreamsLayout: React.FC<TabletStreamsLayoutProps> = ({
|
||||||
<Text style={styles.tabletMovieTitle}>{metadata.name}</Text>
|
<Text style={styles.tabletMovieTitle}>{metadata.name}</Text>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
)}
|
) : type === 'series' && currentEpisode ? (
|
||||||
|
|
||||||
{type === 'series' && currentEpisode && (
|
|
||||||
<View style={styles.tabletEpisodeInfo}>
|
<View style={styles.tabletEpisodeInfo}>
|
||||||
<Text style={[styles.streamsHeroEpisodeNumber, styles.tabletEpisodeText, styles.tabletEpisodeNumber]}>{currentEpisode.episodeString}</Text>
|
<Text style={[styles.streamsHeroEpisodeNumber, styles.tabletEpisodeText, styles.tabletEpisodeNumber]}>{currentEpisode.episodeString}</Text>
|
||||||
<Text style={[styles.streamsHeroTitle, styles.tabletEpisodeText, styles.tabletEpisodeTitle]} numberOfLines={2}>{currentEpisode.name}</Text>
|
<Text style={[styles.streamsHeroTitle, styles.tabletEpisodeText, styles.tabletEpisodeTitle]} numberOfLines={2}>{currentEpisode.name}</Text>
|
||||||
|
|
@ -434,6 +432,10 @@ const TabletStreamsLayout: React.FC<TabletStreamsLayoutProps> = ({
|
||||||
<Text style={[styles.streamsHeroOverview, styles.tabletEpisodeText, styles.tabletEpisodeOverview]} numberOfLines={4}>{currentEpisode.overview}</Text>
|
<Text style={[styles.streamsHeroOverview, styles.tabletEpisodeText, styles.tabletEpisodeOverview]} numberOfLines={4}>{currentEpisode.overview}</Text>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
) : (
|
||||||
|
<View style={styles.tabletEmptyLeftPanel}>
|
||||||
|
<Text style={styles.tabletEmptyLeftPanelText}>No content information available</Text>
|
||||||
|
</View>
|
||||||
)}
|
)}
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
|
|
||||||
|
|
@ -769,6 +771,17 @@ const createStyles = (colors: any) => StyleSheet.create({
|
||||||
lineHeight: 24,
|
lineHeight: 24,
|
||||||
opacity: 0.95,
|
opacity: 0.95,
|
||||||
},
|
},
|
||||||
|
tabletEmptyLeftPanel: {
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
},
|
||||||
|
tabletEmptyLeftPanelText: {
|
||||||
|
color: colors.mediumEmphasis,
|
||||||
|
fontSize: 16,
|
||||||
|
fontStyle: 'italic',
|
||||||
|
},
|
||||||
tabletRightPanel: {
|
tabletRightPanel: {
|
||||||
width: '60%',
|
width: '60%',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
|
|
||||||
|
|
@ -250,9 +250,20 @@ const SeriesContentComponent: React.FC<SeriesContentProps> = ({
|
||||||
const traktService = TraktService.getInstance();
|
const traktService = TraktService.getInstance();
|
||||||
const isAuthed = await traktService.isAuthenticated();
|
const isAuthed = await traktService.isAuthenticated();
|
||||||
if (isAuthed && metadata?.id) {
|
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
|
||||||
|
|
||||||
historyItems.forEach(item => {
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
allHistoryItems.forEach(item => {
|
||||||
if (item.type !== 'episode') return;
|
if (item.type !== 'episode') return;
|
||||||
|
|
||||||
const showImdb = item.show?.ids?.imdb ? `tt${item.show.ids.imdb.replace(/^tt/, '')}` : null;
|
const showImdb = item.show?.ids?.imdb ? `tt${item.show.ids.imdb.replace(/^tt/, '')}` : null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue