Skip to content

Commit

Permalink
Fix for using the correct poster/fanart images
Browse files Browse the repository at this point in the history
  • Loading branch information
mkanet committed May 28, 2024
1 parent ec7732b commit 821091f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/plex_recently_added/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 821091f

Please sign in to comment.