From fc2ab8be252901e524b683fea63dacfa9dc66215 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Wed, 19 May 2021 21:43:32 -0700 Subject: [PATCH] Set themoviedb lookup rating key --- plexpy/notification_handler.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 8c621803..4d3fde55 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -685,7 +685,14 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m # Get TheMovieDB info (for movies and tv only) if plexpy.CONFIG.THEMOVIEDB_LOOKUP and notify_params['media_type'] in ('movie', 'show', 'season', 'episode'): if notify_params.get('themoviedb_id'): - themoveidb_json = get_themoviedb_info(rating_key=rating_key, + if notify_params['media_type'] == 'episode': + lookup_key = notify_params['grandparent_rating_key'] + elif notify_params['media_type'] == 'season': + lookup_key = notify_params['parent_rating_key'] + else: + lookup_key = rating_key + + themoveidb_json = get_themoviedb_info(rating_key=lookup_key, media_type=notify_params['media_type'], themoviedb_id=notify_params['themoviedb_id'])