From 655f1c249e605e6d3bccecdc3926563c8d6b327b Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Tue, 29 Nov 2016 20:54:27 -0800 Subject: [PATCH] Add show and episode title to get_history API --- plexpy/datafactory.py | 6 +++++ plexpy/webserve.py | 52 +++++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index b26b252a..1ae44efb 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -80,7 +80,9 @@ class DataFactory(object): 'session_history_metadata.parent_rating_key', 'session_history_metadata.grandparent_rating_key', 'session_history_metadata.full_title', + 'session_history_metadata.title', 'session_history_metadata.parent_title', + 'session_history_metadata.grandparent_title', 'session_history_metadata.year', 'session_history_metadata.media_index', 'session_history_metadata.parent_media_index', @@ -124,7 +126,9 @@ class DataFactory(object): 'parent_rating_key', 'grandparent_rating_key', 'full_title', + 'title', 'parent_title', + 'grandparent_title', 'year', 'media_index', 'parent_media_index', @@ -217,7 +221,9 @@ class DataFactory(object): 'parent_rating_key': item['parent_rating_key'], 'grandparent_rating_key': item['grandparent_rating_key'], 'full_title': item['full_title'], + 'title': item['parent_title'], 'parent_title': item['parent_title'], + 'grandparent_title': item['grandparent_title'], 'year': item['year'], 'media_index': item['media_index'], 'parent_media_index': item['parent_media_index'], diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 244e5059..26edb82d 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -1609,34 +1609,38 @@ class WebInterface(object): "total_duration": "42 days 5 hrs 18 mins", "filter_duration": "10 hrs 12 mins", "data": - [{"year": 2016, - "paused_counter": 0, - "player": "Plex Web (Chrome)", + [{"date": 1462687607, + "duration": 263, + "friendly_name": "Mother of Dragons", + "full_title": "Game of Thrones - The Red Woman", + "grandparent_rating_key": 351, + "grandparent_title": "Game of Thrones", + "group_count": 1, + "group_ids": "1124", + "id": 1124, + "ip_address": "xxx.xxx.xxx.xxx", + "media_index": 17, + "media_type": "episode", + "parent_media_index": 7, "parent_rating_key": 544, "parent_title": "", - "duration": 263, - "transcode_decision": "transcode", - "rating_key": 4348, - "user_id": 8008135, - "thumb": "/library/metadata/4348/thumb/1462414561", - "id": 1124, - "platform": "Chrome", - "media_type": "episode", - "grandparent_rating_key": 351, - "started": 1462688107, - "full_title": "Game of Thrones - The Red Woman", - "reference_id": 1123, - "date": 1462687607, + "paused_counter": 0, "percent_complete": 84, - "ip_address": "xxx.xxx.xxx.xxx", - "group_ids": "1124", - "media_index": 17, - "friendly_name": "Mother of Dragons", - "watched_status": 0, - "group_count": 1, + "platform": "Chrome", + "player": "Plex Web (Chrome)", + "rating_key": 4348, + "reference_id": 1123, + "session_key": null, + "started": 1462688107, + "state": null, "stopped": 1462688370, - "parent_media_index": 7, - "user": "DanyKhaleesi69" + "thumb": "/library/metadata/4348/thumb/1462414561", + "title": "The Red Woman", + "transcode_decision": "transcode", + "user": "DanyKhaleesi69", + "user_id": 8008135, + "watched_status": 0, + "year": 2016 }, {...}, {...}