From 821091f197484af734064037ccab64fdbaad24eb Mon Sep 17 00:00:00 2001 From: "Michael K. Avanessian" Date: Mon, 27 May 2024 17:04:27 -0700 Subject: [PATCH] Fix for using the correct poster/fanart images --- custom_components/plex_recently_added/parser.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/plex_recently_added/parser.py b/custom_components/plex_recently_added/parser.py index 7a85463..c0177de 100644 --- a/custom_components/plex_recently_added/parser.py +++ b/custom_components/plex_recently_added/parser.py @@ -31,8 +31,10 @@ def parse_data(data, max, base_url, token, identifier, section_key, images_base_ output = [] for item in sorted_data: - thumb = item.get("thumb", item.get("parentThumb", item.get("grandparentThumb", None))) - art = item.get("art", item.get("grandparentArt", None)) + media_type_map = {'movie': ('thumb', 'art'), 'episode': ('grandparentThumb', 'grandparentArt')} + thumb_key, art_key = media_type_map.get(item['type'], ('thumb', 'grandparentArt')) + thumb = item.get(thumb_key, item.get("parentThumb", item.get("grandparentThumb", None))) + art = item.get(art_key, item.get("grandparentArt", None)) deep_link_position = -1 if section_key == "artist": deep_link_position = -2