From 3867dd7bdd397c8198d5b574e33682577afe3220 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 6 Sep 2015 15:51:46 -0700 Subject: [PATCH] Add throttled indicator to dashboard activity --- data/interfaces/default/current_activity.html | 13 +++++++++++-- plexpy/pmsconnect.py | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/data/interfaces/default/current_activity.html b/data/interfaces/default/current_activity.html index 0981d8bf..6c393266 100644 --- a/data/interfaces/default/current_activity.html +++ b/data/interfaces/default/current_activity.html @@ -34,6 +34,7 @@ title Returns the name of the episode, movie or music trac year Returns the year of the episode, movie, or clip. player Returns the name of the platform used to play the stream. platform Returns the type of platform used to play the stream. +throttled Returns true if the transcode session is throttled. audio_decision Returns the audio transcode decision. Either 'transcode', 'copy' or 'direct play'. audio_codec Returns the name of the audio codec. audio_channels Returns the number of audio channels. @@ -115,7 +116,11 @@ DOCUMENTATION :: END % if a['audio_decision'] == 'direct play': Stream  Direct Play % else: - Stream  Transcoding + Stream  Transcoding + % if a['throttled'] == 1: + (Throttled) + % endif + % endif
% if a['audio_decision'] == 'direct play': @@ -129,7 +134,11 @@ DOCUMENTATION :: END % if a['video_decision'] == 'direct play': Stream  Direct Play % else: - Stream  Transcoding + Stream  Transcoding + % if a['throttled']: + (Throttled) + % endif + % endif
% if a['video_decision'] == 'direct play': diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index 5daf1914..41256e2d 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -578,6 +578,7 @@ class PmsConnect(object): if session.getElementsByTagName('TranscodeSession'): transcode_session = session.getElementsByTagName('TranscodeSession')[0] + throttled = helpers.get_xml_attr(transcode_session, 'throttled') audio_decision = helpers.get_xml_attr(transcode_session, 'audioDecision') transcode_audio_channels = helpers.get_xml_attr(transcode_session, 'audioChannels') transcode_audio_codec = helpers.get_xml_attr(transcode_session, 'audioCodec') @@ -620,6 +621,7 @@ class PmsConnect(object): 'rating_key': helpers.get_xml_attr(session, 'ratingKey'), 'parent_rating_key': helpers.get_xml_attr(session, 'parentRatingKey'), 'grandparent_rating_key': helpers.get_xml_attr(session, 'grandparentRatingKey'), + 'throttled': throttled, 'audio_decision': audio_decision, 'audio_channels': audio_channels, 'audio_codec': audio_codec, @@ -664,6 +666,7 @@ class PmsConnect(object): if session.getElementsByTagName('TranscodeSession'): transcode_session = session.getElementsByTagName('TranscodeSession')[0] + throttled = helpers.get_xml_attr(transcode_session, 'throttled') audio_decision = helpers.get_xml_attr(transcode_session, 'audioDecision') transcode_audio_channels = helpers.get_xml_attr(transcode_session, 'audioChannels') transcode_audio_codec = helpers.get_xml_attr(transcode_session, 'audioCodec') @@ -731,6 +734,7 @@ class PmsConnect(object): 'rating_key': helpers.get_xml_attr(session, 'ratingKey'), 'parent_rating_key': helpers.get_xml_attr(session, 'parentRatingKey'), 'grandparent_rating_key': helpers.get_xml_attr(session, 'grandparentRatingKey'), + 'throttled': throttled, 'audio_decision': audio_decision, 'audio_channels': audio_channels, 'audio_codec': audio_codec, @@ -784,6 +788,7 @@ class PmsConnect(object): 'rating_key': helpers.get_xml_attr(session, 'ratingKey'), 'parent_rating_key': helpers.get_xml_attr(session, 'parentRatingKey'), 'grandparent_rating_key': helpers.get_xml_attr(session, 'grandparentRatingKey'), + 'throttled': throttled, 'audio_decision': audio_decision, 'audio_channels': audio_channels, 'audio_codec': audio_codec, @@ -837,6 +842,7 @@ class PmsConnect(object): 'rating_key': helpers.get_xml_attr(session, 'ratingKey'), 'parent_rating_key': helpers.get_xml_attr(session, 'parentRatingKey'), 'grandparent_rating_key': helpers.get_xml_attr(session, 'grandparentRatingKey'), + 'throttled': throttled, 'audio_decision': audio_decision, 'audio_channels': audio_channels, 'audio_codec': audio_codec,