Update SeriesContent.tsx

This commit is contained in:
6ip 2026-03-24 03:55:27 +03:00 committed by GitHub
parent ef1f0c7b09
commit 47a45e9bfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,6 +49,7 @@ interface SeriesContentProps {
mal_id?: number;
external_ids?: {
mal_id?: number;
seasons?: Array<{ season: number; poster?: string; }>;
}
};
imdbId?: string; // IMDb ID for Trakt sync
@ -839,7 +840,7 @@ const SeriesContentComponent: React.FC<SeriesContentProps> = ({
);
}
const renderSeasonSelector = () => {
const = () => {
// Show selector if we have grouped episodes data or can derive from episodes
if (!groupedEpisodes || Object.keys(groupedEpisodes).length <= 1) {
return null;
@ -929,11 +930,24 @@ const SeriesContentComponent: React.FC<SeriesContentProps> = ({
// Get season poster URL (needed for both views)
let seasonPoster = DEFAULT_PLACEHOLDER;
// 1. Highest Priority: TMDB poster via episode data
if (seasonEpisodes[0]?.season_poster_path) {
const tmdbUrl = tmdbService.getImageUrl(seasonEpisodes[0].season_poster_path, 'original');
if (tmdbUrl) seasonPoster = tmdbUrl;
} else if (metadata?.poster) {
seasonPoster = metadata.poster;
if (tmdbUrl) {
seasonPoster = tmdbUrl;
}
}
// If TMDB didn't return a valid poster, check priorities 2 and 3
if (seasonPoster === DEFAULT_PLACEHOLDER) {
// Try to find a custom poster matching the current season number
const customSeasonPoster = metadata?.seasons?.find(s => s.season === season)?.poster;
if (customSeasonPoster) {
// 2. Secondary Priority: Custom Addon Poster
seasonPoster = customSeasonPoster;
} else if (metadata?.poster) {
// 3. Fallback Priority: Main Series Poster
seasonPoster = metadata.poster;
}
}
if (seasonViewMode === 'text') {