From 0f8c122ee322d7b5e91088f456261a0b9ad3c43d Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Wed, 25 Nov 2015 18:12:20 -0800 Subject: [PATCH] Add video and audio decision to notification options --- data/interfaces/default/settings.html | 10 +++++++++- plexpy/notification_handler.py | 23 +++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 2129b5aa..fd3dd1c5 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1001,9 +1001,17 @@ available_notification_agents = sorted(notifiers.available_notification_agents() {episode_num00} The two digit episode number. + + {video_decision} + The video transcode decisions for the media item. + + + {audio_decision} + The audio transcode decisions for the media item. + {transcode_decision} - The transcode decisions for the media item. + The stream transcode decisions for the media item. {year} diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 2b91cc85..256e6d51 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -370,6 +370,8 @@ def build_notify_text(session=None, timeline=None, state=None): duration = helpers.convert_milliseconds_to_minutes(metadata['duration']) # Default values + video_decision = '' + audio_decision = '' transcode_decision = '' stream_duration = 0 view_offset = 0 @@ -381,18 +383,15 @@ def build_notify_text(session=None, timeline=None, state=None): # Session values if session: # Generate a combined transcode decision value - if session['video_decision']: - if session['video_decision'] == 'transcode': - transcode_decision = 'Transcode' - elif session['video_decision'] == 'copy' or session['audio_decision'] == 'copy': - transcode_decision = 'Direct Stream' - else: - transcode_decision = 'Direct Play' - elif session['audio_decision']: - if session['audio_decision'] == 'transcode': - transcode_decision = 'Transcode' - else: - transcode_decision = 'Direct Play' + video_decision = session['video_decision'].title() + audio_decision = session['audio_decision'].title() + + if session['video_decision'] == 'transcode' or session['audio_decision'] == 'transcode': + transcode_decision = 'Transcode' + elif session['video_decision'] == 'copy' or session['audio_decision'] == 'copy': + transcode_decision = 'Direct Stream' + else: + transcode_decision = 'Direct Play' if state != 'play': if session['paused_counter']: