Fix TV show posters to display show artwork instead of episode thumbnails

When displaying recently added TV content, use the show's poster and
metadata instead of the individual episode's thumbnail and info.

Changes to processLibraryItem():
- Poster logic: For TV shows, prioritize grandparentThumb (show poster)
  over thumb (episode thumbnail)
- Title: Use grandparentTitle (show name) instead of title (episode name)
- Year: Use grandparentYear (show year) instead of episode year
- Also applied same logic to music (use album/artist artwork)

Before:
- Shows displayed with episode-specific thumbnails
- Episode titles shown instead of show titles
- Inconsistent visual presentation

After:
- Shows display with proper show posters
- Show titles and years displayed correctly
- Consistent, professional library presentation
- Better visual recognition of TV series

This matches user expectations when browsing recently added TV content,
showing the series artwork rather than individual episode stills.
This commit is contained in:
2026-02-27 18:34:38 +01:00
parent 65ad916df8
commit 73d72c634f

View File

@@ -61,10 +61,28 @@ export function processLibraryItem(
) { ) {
// Get poster/thumbnail URL // Get poster/thumbnail URL
let posterUrl = null; let posterUrl = null;
// For TV shows, prefer grandparentThumb (show poster) over thumb (episode thumbnail)
if (libraryType === "shows") {
if (item.grandparentThumb) {
posterUrl = `${serverUrl}${item.grandparentThumb}?X-Plex-Token=${authToken}`;
} else if (item.thumb) {
posterUrl = `${serverUrl}${item.thumb}?X-Plex-Token=${authToken}`;
}
}
// For music, prefer grandparentThumb (artist/album) over thumb
else if (libraryType === "music") {
if (item.grandparentThumb) {
posterUrl = `${serverUrl}${item.grandparentThumb}?X-Plex-Token=${authToken}`;
} else if (item.thumb) {
posterUrl = `${serverUrl}${item.thumb}?X-Plex-Token=${authToken}`;
}
}
// For movies and other types, use thumb
else {
if (item.thumb) { if (item.thumb) {
posterUrl = `${serverUrl}${item.thumb}?X-Plex-Token=${authToken}`; posterUrl = `${serverUrl}${item.thumb}?X-Plex-Token=${authToken}`;
} else if (item.grandparentThumb) { }
posterUrl = `${serverUrl}${item.grandparentThumb}?X-Plex-Token=${authToken}`;
} }
// Build Plex Web App URL // Build Plex Web App URL
@@ -76,9 +94,20 @@ export function processLibraryItem(
plexUrl = `https://app.plex.tv/desktop/#!/server/${machineIdentifier}/details?key=${encodedKey}`; plexUrl = `https://app.plex.tv/desktop/#!/server/${machineIdentifier}/details?key=${encodedKey}`;
} }
// For shows, use grandparent data (show info) instead of episode info
const title =
libraryType === "shows" && item.grandparentTitle
? item.grandparentTitle
: item.title;
const year =
libraryType === "shows" && item.grandparentYear
? item.grandparentYear
: item.year || item.parentYear || new Date().getFullYear();
const baseItem = { const baseItem = {
title: item.title, title,
year: item.year || item.parentYear || new Date().getFullYear(), year,
poster: posterUrl, poster: posterUrl,
fallbackIcon: getLibraryIcon(libraryType), fallbackIcon: getLibraryIcon(libraryType),
rating: item.rating ? Math.round(item.rating * 10) / 10 : null, rating: item.rating ? Math.round(item.rating * 10) / 10 : null,