diff --git a/plexpy/common.py b/plexpy/common.py index ffc328a5..36588016 100644 --- a/plexpy/common.py +++ b/plexpy/common.py @@ -394,10 +394,12 @@ NOTIFICATION_PARAMETERS = [ {'name': 'Last Viewed Date', 'type': 'str', 'value': 'last_viewed_date', 'description': 'The date (in date format) the item was last viewed on Plex.'}, {'name': 'Studio', 'type': 'str', 'value': 'studio', 'description': 'The studio for the item.'}, {'name': 'Content Rating', 'type': 'int', 'value': 'content_rating', 'description': 'The content rating for the item.', 'example': 'e.g. TV-MA, TV-PG, etc.'}, - {'name': 'Director', 'type': 'str', 'value': 'directors', 'description': 'A list of directors for the item.'}, - {'name': 'Writer', 'type': 'str', 'value': 'writers', 'description': 'A list of writers for the item.'}, - {'name': 'Actor', 'type': 'str', 'value': 'actors', 'description': 'A list of actors for the item.'}, - {'name': 'Genre', 'type': 'str', 'value': 'genres', 'description': 'A list of genres for the item.'}, + {'name': 'Directors', 'type': 'str', 'value': 'directors', 'description': 'A list of directors for the item.'}, + {'name': 'Writers', 'type': 'str', 'value': 'writers', 'description': 'A list of writers for the item.'}, + {'name': 'Actors', 'type': 'str', 'value': 'actors', 'description': 'A list of actors for the item.'}, + {'name': 'Genres', 'type': 'str', 'value': 'genres', 'description': 'A list of genres for the item.'}, + {'name': 'Labels', 'type': 'str', 'value': 'labels', 'description': 'A list of labels for the item.'}, + {'name': 'Collections', 'type': 'str', 'value': 'collections', 'description': 'A list of collections for the item.'}, {'name': 'Summary', 'type': 'str', 'value': 'summary', 'description': 'A short plot summary for the item.'}, {'name': 'Tagline', 'type': 'str', 'value': 'tagline', 'description': 'A tagline for the media item.'}, {'name': 'Rating', 'type': 'float', 'value': 'rating', 'description': 'The rating (out of 10) for the item.'}, diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index c232807d..3189cac3 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -777,6 +777,8 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m 'writers': ', '.join(notify_params['writers']), 'actors': ', '.join(notify_params['actors']), 'genres': ', '.join(notify_params['genres']), + 'labels': ', '.join(notify_params['labels']), + 'collections': ', '.join(notify_params['collections']), 'summary': notify_params['summary'], 'tagline': notify_params['tagline'], 'rating': notify_params['rating'], diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index a8a58c7e..cad9b8f1 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -588,6 +588,7 @@ class PmsConnect(object): actors = [] genres = [] labels = [] + collections = [] if metadata_main.getElementsByTagName('Director'): for director in metadata_main.getElementsByTagName('Director'): @@ -609,6 +610,10 @@ class PmsConnect(object): for label in metadata_main.getElementsByTagName('Label'): labels.append(helpers.get_xml_attr(label, 'tag')) + if metadata_main.getElementsByTagName('Collection'): + for collection in metadata_main.getElementsByTagName('Collection'): + collections.append(helpers.get_xml_attr(collection, 'tag')) + if metadata_type == 'movie': metadata = {'media_type': metadata_type, 'section_id': section_id, @@ -646,6 +651,7 @@ class PmsConnect(object): 'actors': actors, 'genres': genres, 'labels': labels, + 'collections': collections, 'full_title': helpers.get_xml_attr(metadata_main, 'title') } @@ -686,6 +692,7 @@ class PmsConnect(object): 'actors': actors, 'genres': genres, 'labels': labels, + 'collections': collections, 'full_title': helpers.get_xml_attr(metadata_main, 'title') } @@ -728,6 +735,7 @@ class PmsConnect(object): 'actors': show_details['actors'], 'genres': show_details['genres'], 'labels': show_details['labels'], + 'collections': show_details['collections'], 'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle'), helpers.get_xml_attr(metadata_main, 'title')) } @@ -771,6 +779,7 @@ class PmsConnect(object): 'actors': show_details['actors'], 'genres': show_details['genres'], 'labels': show_details['labels'], + 'collections': show_details['collections'], 'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'grandparentTitle'), helpers.get_xml_attr(metadata_main, 'title')) } @@ -812,6 +821,7 @@ class PmsConnect(object): 'actors': actors, 'genres': genres, 'labels': labels, + 'collections': collections, 'full_title': helpers.get_xml_attr(metadata_main, 'title') } @@ -854,6 +864,7 @@ class PmsConnect(object): 'actors': actors, 'genres': genres, 'labels': labels, + 'collections': collections, 'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle'), helpers.get_xml_attr(metadata_main, 'title')) } @@ -897,6 +908,7 @@ class PmsConnect(object): 'actors': actors, 'genres': album_details['genres'], 'labels': album_details['labels'], + 'collections': album_details['collections'], 'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'grandparentTitle'), helpers.get_xml_attr(metadata_main, 'title')) } @@ -938,6 +950,7 @@ class PmsConnect(object): 'actors': actors, 'genres': genres, 'labels': labels, + 'collections': collections, 'full_title': helpers.get_xml_attr(metadata_main, 'title') } @@ -980,6 +993,7 @@ class PmsConnect(object): 'actors': actors, 'genres': photo_album_details['genres'], 'labels': photo_album_details['labels'], + 'collections': photo_album_details['collections'], 'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle'), helpers.get_xml_attr(metadata_main, 'title')) } @@ -1025,6 +1039,7 @@ class PmsConnect(object): 'actors': actors, 'genres': genres, 'labels': labels, + 'collections': collections, 'full_title': helpers.get_xml_attr(metadata_main, 'title') } @@ -1065,6 +1080,7 @@ class PmsConnect(object): 'actors': actors, 'genres': genres, 'labels': labels, + 'collections': collections, 'full_title': helpers.get_xml_attr(metadata_main, 'title') }