From 4b344908006be562d55723444cb53cf637e824e9 Mon Sep 17 00:00:00 2001
From: Jonathan Wong
{server_name} | +The name of your Plex Server. | +||
{user} | The username of the person streaming. | ||
{server_name} | -The name of your Plex Server. | +{ip_address} | +The IP address of the person streaming. |
{player} | @@ -782,6 +786,10 @@ available_notification_agents = notifiers.available_notification_agents(){platform} | The type of client being used for playback. | |
{transcode_decision} | +The transcode decisions for the media item. | +||
{title} | The title of the item being played back. | @@ -798,10 +806,6 @@ available_notification_agents = notifiers.available_notification_agents(){album_name} | The title of the album being played back if item is track. |
{transcode_decision} | -The transcode decisions for the media item. | -||
{year} | The release year for the media item. | diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 5330b7e5..3358df3f 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -303,8 +303,12 @@ def build_notify_text(session, state): duration = helpers.convert_milliseconds_to_minutes(item_metadata['duration']) view_offset = helpers.convert_milliseconds_to_minutes(session['view_offset']) + ip_address = 'IP unknown' stream_duration = 0 if state != 'play': + if session['ip_address'].index('.') > -1: + ip_address = session['ip_address'] + if session['paused_counter']: stream_duration = int((time.time() - helpers.cast_to_float(session['started']) - helpers.cast_to_float(session['paused_counter'])) / 60) @@ -315,6 +319,7 @@ def build_notify_text(session, state): available_params = {'server_name': server_name, 'user': session['friendly_name'], + 'ip_address': ip_address, 'player': session['player'], 'title': full_title, 'show_name': item_metadata['grandparent_title'],