From 47a45e9bfcd7c1d94d49469c678f18d3d071e21b Mon Sep 17 00:00:00 2001 From: 6ip <77052507+6ip@users.noreply.github.com> Date: Tue, 24 Mar 2026 03:55:27 +0300 Subject: [PATCH] Update SeriesContent.tsx --- src/components/metadata/SeriesContent.tsx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/components/metadata/SeriesContent.tsx b/src/components/metadata/SeriesContent.tsx index bdc5984b..0d2f9c5a 100644 --- a/src/components/metadata/SeriesContent.tsx +++ b/src/components/metadata/SeriesContent.tsx @@ -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 = ({ ); } - 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 = ({ // 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') {