diff --git a/plexpy/common.py b/plexpy/common.py index 840beefd..dd233f4b 100644 --- a/plexpy/common.py +++ b/plexpy/common.py @@ -468,7 +468,8 @@ NOTIFICATION_PARAMETERS = [ {'name': 'Title', 'type': 'str', 'value': 'title', 'description': 'The full title of the item.'}, {'name': 'Library Name', 'type': 'str', 'value': 'library_name', 'description': 'The library name of the item.'}, {'name': 'Show Name', 'type': 'str', 'value': 'show_name', 'description': 'The title of the TV series.'}, - {'name': 'Episode Name', 'type': 'str', 'value': 'episode_name', 'description': 'The title of the episode.'}, + {'name': 'Season Name', 'type': 'str', 'value': 'season_name', 'description': 'The title of the TV season.'}, + {'name': 'Episode Name', 'type': 'str', 'value': 'episode_name', 'description': 'The title of the TV episode.'}, {'name': 'Artist Name', 'type': 'str', 'value': 'artist_name', 'description': 'The name of the artist.'}, {'name': 'Album Name', 'type': 'str', 'value': 'album_name', 'description': 'The title of the album.'}, {'name': 'Track Name', 'type': 'str', 'value': 'track_name', 'description': 'The title of the track.'}, diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 6a846316..0d263b29 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -781,6 +781,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m if ((manual_trigger or plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED_GRANDPARENT) and notify_params['media_type'] in ('show', 'artist')): show_name = notify_params['title'] + season_name = '' episode_name = '' artist_name = notify_params['title'] album_name = '' @@ -800,6 +801,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m elif ((manual_trigger or plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED_PARENT) and notify_params['media_type'] in ('season', 'album')): show_name = notify_params['parent_title'] + season_name = notify_params['title'] episode_name = '' artist_name = notify_params['parent_title'] album_name = notify_params['title'] @@ -819,6 +821,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m else: show_name = notify_params['grandparent_title'] + season_name = notify_params['parent_title'] episode_name = notify_params['title'] artist_name = notify_params['grandparent_title'] album_name = notify_params['parent_title'] @@ -982,6 +985,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m 'title': notify_params['full_title'], 'library_name': notify_params['library_name'], 'show_name': show_name, + 'season_name': season_name, 'episode_name': episode_name, 'artist_name': artist_name, 'album_name': album_name, diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index ebccce84..fb30bc5f 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -765,13 +765,17 @@ class PrettyMetadata(object): elif self.media_type == 'show': title = '%s (%s)' % (self.parameters['show_name'], self.parameters['year']) elif self.media_type == 'season': - title = '%s - Season %s' % (self.parameters['show_name'], self.parameters['season_num']) + title = '%s - %s' % (self.parameters['show_name'], self.parameters['season_name']) elif self.media_type == 'episode': - title = '%s - %s (S%s %s E%s)' % (self.parameters['show_name'], - self.parameters['episode_name'], - self.parameters['season_num'], - divider, - self.parameters['episode_num']) + if self.parameters['season_name'].startswith('Season '): + season = 'S%s' % self.parameters['season_num'] + else: + season = self.parameters['season_name'] + title = '%s - %s (%s %s E%s)' % (self.parameters['show_name'], + self.parameters['episode_name'], + season, + divider, + self.parameters['episode_num']) elif self.media_type == 'artist': title = self.parameters['artist_name'] elif self.media_type == 'album': diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index 333fb61d..983a3eef 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -925,7 +925,7 @@ class PmsConnect(object): 'parent_rating_key': parent_rating_key, 'grandparent_rating_key': helpers.get_xml_attr(metadata_main, 'grandparentRatingKey'), 'title': helpers.get_xml_attr(metadata_main, 'title'), - 'parent_title': 'Season %s' % helpers.get_xml_attr(metadata_main, 'parentIndex'), + 'parent_title': helpers.get_xml_attr(metadata_main, 'parentTitle'), 'grandparent_title': helpers.get_xml_attr(metadata_main, 'grandparentTitle'), 'original_title': helpers.get_xml_attr(metadata_main, 'originalTitle'), 'sort_title': helpers.get_xml_attr(metadata_main, 'titleSort'),