diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index de1f88ef..c7a2f552 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -787,6 +787,8 @@ class PmsConnect(object): 'labels': labels, 'collections': collections, 'guids': guids, + 'parent_guids': [], + 'grandparent_guids': [], 'full_title': helpers.get_xml_attr(metadata_main, 'title'), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')), 'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1') @@ -841,6 +843,8 @@ class PmsConnect(object): 'labels': labels, 'collections': collections, 'guids': guids, + 'parent_guids': [], + 'grandparent_guids': [], 'full_title': helpers.get_xml_attr(metadata_main, 'title'), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')), 'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1') @@ -897,7 +901,9 @@ class PmsConnect(object): 'genres': show_details.get('genres', []), 'labels': show_details.get('labels', []), 'collections': show_details.get('collections', []), - 'guids': show_details.get('guids', []), + 'guids': guids, + 'parent_guids': show_details.get('guids', []), + 'grandparent_guids': [], 'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle'), helpers.get_xml_attr(metadata_main, 'title')), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')), @@ -916,6 +922,7 @@ class PmsConnect(object): parent_rating_key = helpers.get_xml_attr(metadata_main, 'parentRatingKey') parent_media_index = helpers.get_xml_attr(metadata_main, 'parentIndex') parent_thumb = helpers.get_xml_attr(metadata_main, 'parentThumb') + season_details = self.get_metadata_details(parent_rating_key) if parent_rating_key else {} if not plex_guid and not parent_rating_key: # Try getting the parent_rating_key from the parent_thumb @@ -970,7 +977,9 @@ class PmsConnect(object): 'genres': show_details.get('genres', []), 'labels': show_details.get('labels', []), 'collections': show_details.get('collections', []), - 'guids': show_details.get('guids', []), + 'guids': guids, + 'parent_guids': season_details.get('guids', []), + 'grandparent_guids': show_details.get('guids', []), 'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'grandparentTitle'), helpers.get_xml_attr(metadata_main, 'title')), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')), @@ -1021,6 +1030,8 @@ class PmsConnect(object): 'labels': labels, 'collections': collections, 'guids': guids, + 'parent_guids': [], + 'grandparent_guids': [], 'full_title': helpers.get_xml_attr(metadata_main, 'title'), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')), 'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1') @@ -1072,6 +1083,8 @@ class PmsConnect(object): 'labels': labels, 'collections': collections, 'guids': guids, + 'parent_guids': artist_details.get('guids', []), + 'grandparent_guids': [], 'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle'), helpers.get_xml_attr(metadata_main, 'title')), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')), @@ -1125,7 +1138,9 @@ class PmsConnect(object): 'genres': album_details.get('genres', []), 'labels': album_details.get('labels', []), 'collections': album_details.get('collections', []), - 'guids': album_details.get('guids', []), + 'guids': guids, + 'parent_guids': album_details.get('guids', []), + 'grandparent_guids': album_details.get('parent_guids', []), 'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'title'), track_artist), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')), @@ -1176,6 +1191,8 @@ class PmsConnect(object): 'labels': labels, 'collections': collections, 'guids': guids, + 'parent_guids': [], + 'grandparent_guids': [], 'full_title': helpers.get_xml_attr(metadata_main, 'title'), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')), 'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1') @@ -1226,7 +1243,9 @@ class PmsConnect(object): 'genres': photo_album_details.get('genres', []), 'labels': photo_album_details.get('labels', []), 'collections': photo_album_details.get('collections', []), - 'guids': photo_album_details.get('guids', []), + 'guids': [], + 'parent_guids': photo_album_details.get('guids', []), + 'grandparent_guids': [], 'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle') or library_name, helpers.get_xml_attr(metadata_main, 'title')), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')), @@ -1281,6 +1300,8 @@ class PmsConnect(object): 'labels': labels, 'collections': collections, 'guids': guids, + 'parent_guids': [], + 'grandparent_guids': [], 'full_title': helpers.get_xml_attr(metadata_main, 'title'), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'childCount')), 'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1'), @@ -1351,6 +1372,8 @@ class PmsConnect(object): 'labels': labels, 'collections': collections, 'guids': guids, + 'parent_guids': [], + 'grandparent_guids': [], 'full_title': helpers.get_xml_attr(metadata_main, 'title'), 'extra_type': helpers.get_xml_attr(metadata_main, 'extraType'), 'sub_type': helpers.get_xml_attr(metadata_main, 'subtype'), diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 1d61eece..85ab4ecf 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -5283,16 +5283,21 @@ class WebInterface(object): Returns: json: {"actors": [ - "Kit Harington", "Emilia Clarke", - "Isaac Hempstead-Wright", + "Lena Headey", + "Sophie Turner", + "Kit Harington", + "Peter Dinklage", + "Nikolaj Coster-Waldau", "Maisie Williams", - "Liam Cunningham", + "Iain Glen", + "John Bradley", + "Alfie Allen" ], "added_at": "1461572396", "art": "/library/metadata/1219/art/1462175063", - "audience_rating": "8", - "audience_rating_image": "rottentomatoes://image.rating.upright", + "audience_rating": "7.4", + "audience_rating_image": "themoviedb://image.rating", "banner": "/library/metadata/1219/banner/1462175063", "collections": [], "content_rating": "TV-MA", @@ -5302,16 +5307,26 @@ class WebInterface(object): "duration": "2998290", "full_title": "Game of Thrones - The Red Woman", "genres": [ - "Adventure", + "Action/Adventure", "Drama", - "Fantasy" + "Fantasy", + "Romance" + ], + "grandparent_guid": "plex://show/5d9c086c46115600200aa2fe", + "grandparent_guids": [ + "imdb://tt0944947", + "tmdb://1399", + "tvdb://121361" ], - "grandparent_guid": "com.plexapp.agents.thetvdb://121361?lang=en", "grandparent_rating_key": "1219", "grandparent_thumb": "/library/metadata/1219/thumb/1462175063", "grandparent_title": "Game of Thrones", - "guid": "com.plexapp.agents.thetvdb://121361/6/1?lang=en", - "guids": [], + "guid": "plex://episode/5d9c1276e9d5a1001f4ff2fa", + "guids": [ + "imdb://tt3658014", + "tmdb://1156503", + "tvdb://5469015" + ], "labels": [], "last_viewed_at": "1462165717", "library_name": "TV Shows", @@ -5401,18 +5416,21 @@ class WebInterface(object): "media_type": "episode", "original_title": "", "originally_available_at": "2016-04-24", - "parent_guid": "com.plexapp.agents.thetvdb://121361/6?lang=en", + "parent_guid": "plex://season/602e67e61d3358002c4120f7", + "parent_guids": [ + "tvdb://651357" + ], "parent_media_index": "6", "parent_rating_key": "153036", "parent_thumb": "/library/metadata/153036/thumb/1462175062", - "parent_title": "", - "rating": "7.8", - "rating_image": "rottentomatoes://image.rating.ripe", + "parent_title": "Season 6", + "rating": "", + "rating_image": "", "rating_key": "153037", "section_id": "2", "sort_title": "Red Woman", - "studio": "HBO", - "summary": "Jon Snow is dead. Daenerys meets a strong man. Cersei sees her daughter again.", + "studio": "Revolution Sun Studios", + "summary": "The fate of Jon Snow is revealed. Daenerys meets a strong man. Cersei sees her daughter once again.", "tagline": "", "thumb": "/library/metadata/153037/thumb/1462175060", "title": "The Red Woman",