From 01fe7bf6121f4d96590814cb6f57737c1689f8bd Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Fri, 29 Jan 2016 19:06:08 -0800 Subject: [PATCH] Reorganize notification options --- data/interfaces/default/settings.html | 80 +++++++++++++++------------ plexpy/notification_handler.py | 4 +- 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 96c2f14f..f05d4ba7 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1074,7 +1074,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents() - Server Details + Global @@ -1087,6 +1087,18 @@ available_notification_agents = sorted(notifiers.available_notification_agents() {server_uptime} The uptime (in days, hours, mins, secs) of your Plex Server. + + {action} + The action that triggered the notification. + + + {datestamp} + The date the notification was triggered. + + + {timestamp} + The time the notification was triggered. + @@ -1102,18 +1114,6 @@ available_notification_agents = sorted(notifiers.available_notification_agents() - - - - - - - - - - - - @@ -1130,10 +1130,6 @@ available_notification_agents = sorted(notifiers.available_notification_agents() - - - - @@ -1241,37 +1237,41 @@ available_notification_agents = sorted(notifiers.available_notification_agents() + + + + - + - + - + - + - + - + - + - + @@ -1279,43 +1279,51 @@ available_notification_agents = sorted(notifiers.available_notification_agents() - + + + + + + + + + - + - + - + - + - + - + - + - + @@ -1339,11 +1347,11 @@ available_notification_agents = sorted(notifiers.available_notification_agents() - + - +
{streams} The number of concurrent streams.
{action}The action that triggered the notification.
{datestamp}The date the notification was triggered.
{timestamp}The time the notification was triggered.
{user} The username of the person streaming.{ip_address} The IP address of the device being used for playback. (PMS 0.9.14 and above)
{media_type}The type of media being played (movie, episode, track).
{stream_duration} The stream duration (in minutes) for the item.
{media_type}The type of media (movie, episode, track).
{title}The full title of the item being played.The full title of the item.
{library_name}The library title of the item being played.The library title of the media item.
{show_name}The title of the TV series being played.The title of the TV series.
{episode_name}The title of the episode being played.The title of the episode.
{artist_name}The name of the artist being played.The name of the artistd.
{album_name}The title of the album being played.The title of the album.
{track_name}The title of the track being played.The title of the track.
{season_num}The season number for the media item if item is episode.The season number for the item if item is episode.
{season_num00}
{episode_num}The episode number for the media item if item is episode.The episode number for the item if item is episode.
{episode_num00} The two digit episode number.
{track_num}The track number for the item if item is track.
{track_num00}The two digit track number.
{year}The release year for the media item.The release year for the item.
{studio}The studio for the media item.The studio for the item.
{content_rating}The content rating for the media item. (e.g. TV-MA, TV-PG, etc.)The content rating for the item. (e.g. TV-MA, TV-PG, etc.)
{directors}A list of directors for the media item.A list of directors for the item.
{writers}A list of writers for the media item.A list of writers for the item.
{actors}A list of actors for the media item.A list of actors for the item.
{genres}A list of genres for the media item.A list of genres for the item.
{summary}A short plot summary for the media item.A short plot summary for the item.
{tagline}
{parent_rating_key}The unique identifier for the item parent (season or album).The unique identifier for the item's parent (season or album).
{grandparent_rating_key}The unique identifier for the item grandparent (TV show or artist).The unique identifier for the item's grandparent (TV show or artist).
diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index cea0b601..2e400ca8 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -519,10 +519,10 @@ def build_notify_text(session=None, timeline=None, state=None): available_params = {'server_name': server_name, 'server_uptime': server_uptime, - 'streams': stream_count, 'action': state, 'datestamp': arrow.now().format(plexpy.CONFIG.DATE_FORMAT.replace('Do','').replace('zz','')), 'timestamp': arrow.now().format(plexpy.CONFIG.TIME_FORMAT.replace('Do','').replace('zz','')), + 'streams': stream_count, 'user': user, 'platform': platform, 'player': player, @@ -563,6 +563,8 @@ def build_notify_text(session=None, timeline=None, state=None): 'season_num00': metadata['parent_media_index'].zfill(2), 'episode_num': metadata['media_index'].zfill(1), 'episode_num00': metadata['media_index'].zfill(2), + 'track_num': metadata['media_index'].zfill(1), + 'track_num00': metadata['media_index'].zfill(2), 'year': metadata['year'], 'studio': metadata['studio'], 'content_rating': metadata['content_rating'],