Merge pull request #321 from chrisk325/main

This commit is contained in:
Nayif 2025-12-30 17:46:50 +05:30 committed by GitHub
commit ad18e30de7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 62 additions and 37 deletions

View file

@ -672,13 +672,14 @@ const AppleTVHero: React.FC<AppleTVHeroProps> = ({
id: currentItem.id,
type: currentItem.type,
title: currentItem.name,
addonId: currentItem.addonId,
metadata: {
poster: currentItem.poster,
banner: currentItem.banner,
releaseInfo: currentItem.releaseInfo,
genres: currentItem.genres
}
};
}
};
// Add resume data if we have progress that's not near completion
if (shouldResume && watchProgress) {
@ -697,6 +698,7 @@ const AppleTVHero: React.FC<AppleTVHeroProps> = ({
id: currentItem.id,
type: currentItem.type,
title: currentItem.name,
addonId: currentItem.addonId,
metadata: {
poster: currentItem.poster,
banner: currentItem.banner,
@ -1184,6 +1186,7 @@ const AppleTVHero: React.FC<AppleTVHeroProps> = ({
navigation.navigate('Metadata', {
id: currentItem.id,
type: currentItem.type,
addonId: currentItem.addonId,
});
}
}}
@ -1220,6 +1223,7 @@ const AppleTVHero: React.FC<AppleTVHeroProps> = ({
navigation.navigate('Metadata', {
id: currentItem.id,
type: currentItem.type,
addonId: currentItem.addonId,
});
}
}}

View file

@ -35,6 +35,7 @@ interface ContinueWatchingItem extends StreamingContent {
season?: number;
episode?: number;
episodeTitle?: string;
addonId?: string;
}
// Define the ref interface
@ -997,12 +998,14 @@ const ContinueWatchingSection = React.forwardRef<ContinueWatchingRef>((props, re
id: item.id,
type: item.type,
episodeId: episodeId
addonId: item.addonId
});
} else {
// For movies or series without specific episode, navigate to main content
navigation.navigate('Streams', {
id: item.id,
type: item.type
addonId: item.addonId
});
}
} catch (error) {
@ -1505,4 +1508,4 @@ const styles = StyleSheet.create({
export default React.memo(ContinueWatchingSection, (prevProps, nextProps) => {
// This component has no props that would cause re-renders
return true;
});
});

View file

@ -228,9 +228,9 @@ const HeroCarousel: React.FC<HeroCarouselProps> = ({ items, loading = false }) =
const contentPadding = useMemo(() => ({ paddingHorizontal: (windowWidth - cardWidth) / 2 }), [windowWidth, cardWidth]);
const handleNavigateToMetadata = useCallback((id: string, type: any) => {
navigation.navigate('Metadata', { id, type });
}, [navigation]);
const handleNavigateToMetadata = useCallback((id: string, type: any, addonId?: string) => {
navigation.navigate('Metadata', { id, type, addonId });
}, [navigation]);
// Container animation based on scroll - must be before early returns
// TEMPORARILY DISABLED FOR PERFORMANCE TESTING
@ -399,7 +399,7 @@ const HeroCarousel: React.FC<HeroCarouselProps> = ({ items, loading = false }) =
colors={currentTheme.colors}
logoFailed={failedLogoIds.has(item.id)}
onLogoError={() => setFailedLogoIds((prev) => new Set(prev).add(item.id))}
onPressInfo={() => handleNavigateToMetadata(item.id, item.type)}
onPressInfo={() => handleNavigateToMetadata(item.id, item.type, item.addonId)}
scrollX={scrollX}
index={index}
flipped={!!flippedMap[item.id]}

View file

@ -50,6 +50,7 @@ interface ThisWeekEpisode {
vote_average: number;
still_path: string | null;
season_poster_path: string | null;
addonId?: string;
// Grouping fields
isGroup?: boolean;
episodeCount?: number;
@ -195,34 +196,37 @@ export const ThisWeekSection = React.memo(() => {
}, [calendarData]);
const handleEpisodePress = (episode: ThisWeekEpisode) => {
// For grouped episodes, always go to series details
if (episode.isGroup) {
navigation.navigate('Metadata', {
id: episode.seriesId,
type: 'series'
});
return;
}
// For upcoming episodes, go to the metadata screen
if (!episode.isReleased) {
const episodeId = `${episode.seriesId}:${episode.season}:${episode.episode}`;
navigation.navigate('Metadata', {
id: episode.seriesId,
type: 'series',
episodeId
});
return;
}
// For released episodes, go to the streams screen
const episodeId = `${episode.seriesId}:${episode.season}:${episode.episode}`;
navigation.navigate('Streams', {
// For grouped episodes, always go to series details
if (episode.isGroup) {
navigation.navigate('Metadata', {
id: episode.seriesId,
type: 'series',
episodeId
addonId: episode.addonId,
});
};
return;
}
// For upcoming episodes, go to the metadata screen
if (!episode.isReleased) {
const episodeId = `${episode.seriesId}:${episode.season}:${episode.episode}`;
navigation.navigate('Metadata', {
id: episode.seriesId,
type: 'series',
episodeId,
addonId: episode.addonId,
});
return;
}
// For released episodes, go to the streams screen
const episodeId = `${episode.seriesId}:${episode.season}:${episode.episode}`;
navigation.navigate('Streams', {
id: episode.seriesId,
type: 'series',
episodeId,
addonId: episode.addonId,
});
};
const handleViewAll = () => {
navigation.navigate('Calendar' as any);
@ -562,4 +566,4 @@ const styles = StyleSheet.create({
borderWidth: 1,
zIndex: -1,
},
});
});

View file

@ -22,6 +22,7 @@ interface CalendarEpisode {
vote_average: number;
still_path: string | null;
season_poster_path: string | null;
addonId?: string;
}
interface CalendarSection {
@ -219,6 +220,7 @@ export const useCalendarData = (): UseCalendarDataReturn => {
vote_average: tmdbEpisode.vote_average || 0,
still_path: tmdbEpisode.still_path || null,
season_poster_path: tmdbEpisode.season_poster_path || null
addonId: series.addonId,
};
@ -245,6 +247,7 @@ export const useCalendarData = (): UseCalendarDataReturn => {
vote_average: 0,
still_path: null,
season_poster_path: null
addonId: series.addonId,
}
};
}
@ -265,6 +268,7 @@ export const useCalendarData = (): UseCalendarDataReturn => {
vote_average: 0,
still_path: null,
season_poster_path: null
addonId: series.addonId,
}
};
}

View file

@ -103,6 +103,7 @@ export function useFeaturedContent() {
id: item.id,
type: item.type,
name: item.name,
addonId: item.addonId,
poster: item.poster,
banner: (item as any).banner,
logo: (item as any).logo,
@ -537,4 +538,4 @@ export function useFeaturedContent() {
isItemSaved,
refreshFeatured
};
}
}

View file

@ -909,8 +909,13 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
// Centralized logo fetching logic
try {
if (addonLogo) {
finalMetadata.logo = addonLogo;
if (__DEV__) {
console.log('[useMetadata] Using addon-provided logo:', { hasLogo: true });
}
// Check both master switch AND granular logos setting
if (settings.enrichMetadataWithTMDB && settings.tmdbEnrichLogos) {
} else if (settings.enrichMetadataWithTMDB && settings.tmdbEnrichLogos) {
// Only use TMDB logos when both enrichment AND logos option are ON
const tmdbService = TMDBService.getInstance();
const preferredLanguage = settings.tmdbLanguagePreference || 'en';
@ -2464,4 +2469,4 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
collectionMovies,
loadingCollection,
};
};
};

View file

@ -54,6 +54,7 @@ export interface StreamingContent {
id: string;
type: string;
name: string;
addonId?: string;
tmdbId?: number;
poster: string;
posterShape?: 'poster' | 'square' | 'landscape';
@ -835,6 +836,7 @@ class CatalogService {
id: meta.id,
type: meta.type,
name: meta.name,
addonId,
poster: posterUrl,
posterShape: meta.posterShape || 'poster', // Use addon's shape or default to poster type
banner: meta.background,
@ -857,6 +859,7 @@ class CatalogService {
id: meta.id,
type: meta.type,
name: meta.name,
addonId,
poster: meta.poster || 'https://via.placeholder.com/300x450/cccccc/666666?text=No+Image',
posterShape: meta.posterShape || 'poster',
banner: meta.background,

View file

@ -5,6 +5,7 @@ interface WatchProgress {
currentTime: number;
duration: number;
lastUpdated: number;
addonId?: string;
traktSynced?: boolean;
traktLastSynced?: number;
traktProgress?: number;
@ -707,4 +708,4 @@ class StorageService {
}
}
export const storageService = StorageService.getInstance();
export const storageService = StorageService.getInstance();