Browse Source

Fix TV show poster composite image issue

- Improve TV show ID extraction logic to use SeriesId and ShowId fields
- Add fallback logic to avoid episode IDs that cause composite posters
- Ensures unique series posters instead of overlaid/repeated images
mgomon 11 months ago
parent
commit
fe8c91540a
1 changed files with 9 additions and 3 deletions
  1. 9 3
      api/homepage/jellystat.php

+ 9 - 3
api/homepage/jellystat.php

@@ -1046,9 +1046,15 @@ trait JellyStatHomepageItem
                         // For movies, use the NowPlayingItemId
                         $actualItemId = $result['NowPlayingItemId'] ?? null;
                     } elseif ($contentType === 'show') {
-                        // For TV shows, use ParentId (series ID) for series poster
-                        // ParentId should be the series, not the episode
-                        $actualItemId = $result['ParentId'] ?? $result['NowPlayingItemId'] ?? null;
+                        // For TV shows, try different ID fields to get the proper series ID
+                        // SeriesId is most specific, then try other fields
+                        $actualItemId = $result['SeriesId'] ?? $result['ShowId'] ?? $result['ParentId'] ?? $result['NowPlayingItemId'] ?? null;
+                        
+                        // If ParentId and NowPlayingItemId are the same, it might be pointing to an episode
+                        // In that case, we should try to use a different approach
+                        if ($actualItemId === $result['NowPlayingItemId'] && !empty($result['ParentId']) && $result['ParentId'] !== $result['NowPlayingItemId']) {
+                            $actualItemId = $result['ParentId'];
+                        }
                     } elseif ($contentType === 'music') {
                         // For music, use NowPlayingItemId (album/track)
                         $actualItemId = $result['NowPlayingItemId'] ?? null;