Skip to content

Commit 821091f

Browse files
committed
Fix for using the correct poster/fanart images
1 parent ec7732b commit 821091f

File tree

1 file changed

+4
-2
lines changed
  • custom_components/plex_recently_added

1 file changed

+4
-2
lines changed

custom_components/plex_recently_added/parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ def parse_data(data, max, base_url, token, identifier, section_key, images_base_
3131

3232
output = []
3333
for item in sorted_data:
34-
thumb = item.get("thumb", item.get("parentThumb", item.get("grandparentThumb", None)))
35-
art = item.get("art", item.get("grandparentArt", None))
34+
media_type_map = {'movie': ('thumb', 'art'), 'episode': ('grandparentThumb', 'grandparentArt')}
35+
thumb_key, art_key = media_type_map.get(item['type'], ('thumb', 'grandparentArt'))
36+
thumb = item.get(thumb_key, item.get("parentThumb", item.get("grandparentThumb", None)))
37+
art = item.get(art_key, item.get("grandparentArt", None))
3638
deep_link_position = -1
3739
if section_key == "artist":
3840
deep_link_position = -2

0 commit comments

Comments
 (0)