Reorganize notification options

This commit is contained in:
JonnyWong16 2016-01-29 19:06:08 -08:00
parent 1cb75bd053
commit 01fe7bf612
2 changed files with 47 additions and 37 deletions

View file

@ -1074,7 +1074,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<thead> <thead>
<tr> <tr>
<th> <th>
Server Details Global
</th> </th>
</tr> </tr>
</thead> </thead>
@ -1087,6 +1087,18 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<td><strong>{server_uptime}</strong></td> <td><strong>{server_uptime}</strong></td>
<td>The uptime (in days, hours, mins, secs) of your Plex Server.</td> <td>The uptime (in days, hours, mins, secs) of your Plex Server.</td>
</tr> </tr>
<tr>
<td><strong>{action}</strong></td>
<td>The action that triggered the notification.</td>
</tr>
<tr>
<td><strong>{datestamp}</strong></td>
<td>The date the notification was triggered.</td>
</tr>
<tr>
<td><strong>{timestamp}</strong></td>
<td>The time the notification was triggered.</td>
</tr>
</tbody> </tbody>
</table> </table>
<table class="notification-params"> <table class="notification-params">
@ -1102,18 +1114,6 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<td><strong>{streams}</strong></td> <td><strong>{streams}</strong></td>
<td>The number of concurrent streams.</td> <td>The number of concurrent streams.</td>
</tr> </tr>
<tr>
<td><strong>{action}</strong></td>
<td>The action that triggered the notification.</td>
</tr>
<tr>
<td><strong>{datestamp}</strong></td>
<td>The date the notification was triggered.</td>
</tr>
<tr>
<td><strong>{timestamp}</strong></td>
<td>The time the notification was triggered.</td>
</tr>
<tr> <tr>
<td><strong>{user}</strong></td> <td><strong>{user}</strong></td>
<td>The username of the person streaming.</td> <td>The username of the person streaming.</td>
@ -1130,10 +1130,6 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<td><strong>{ip_address}</strong></td> <td><strong>{ip_address}</strong></td>
<td>The IP address of the device being used for playback. (PMS 0.9.14 and above)</td> <td>The IP address of the device being used for playback. (PMS 0.9.14 and above)</td>
</tr> </tr>
<tr>
<td><strong>{media_type}</strong></td>
<td>The type of media being played (movie, episode, track).</td>
</tr>
<tr> <tr>
<td><strong>{stream_duration}</strong></td> <td><strong>{stream_duration}</strong></td>
<td>The stream duration (in minutes) for the item.</td> <td>The stream duration (in minutes) for the item.</td>
@ -1241,37 +1237,41 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<td><strong>{media_type}</strong></td>
<td>The type of media (movie, episode, track).</td>
</tr>
<tr> <tr>
<td><strong>{title}</strong></td> <td><strong>{title}</strong></td>
<td>The full title of the item being played.</td> <td>The full title of the item.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{library_name}</strong></td> <td><strong>{library_name}</strong></td>
<td>The library title of the item being played.</td> <td>The library title of the media item.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{show_name}</strong></td> <td><strong>{show_name}</strong></td>
<td>The title of the TV series being played.</td> <td>The title of the TV series.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{episode_name}</strong></td> <td><strong>{episode_name}</strong></td>
<td>The title of the episode being played.</td> <td>The title of the episode.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{artist_name}</strong></td> <td><strong>{artist_name}</strong></td>
<td>The name of the artist being played.</td> <td>The name of the artistd.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{album_name}</strong></td> <td><strong>{album_name}</strong></td>
<td>The title of the album being played.</td> <td>The title of the album.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{track_name}</strong></td> <td><strong>{track_name}</strong></td>
<td>The title of the track being played.</td> <td>The title of the track.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{season_num}</strong></td> <td><strong>{season_num}</strong></td>
<td>The season number for the media item if item is episode.</td> <td>The season number for the item if item is episode.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{season_num00}</strong></td> <td><strong>{season_num00}</strong></td>
@ -1279,43 +1279,51 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
</tr> </tr>
<tr> <tr>
<td><strong>{episode_num}</strong></td> <td><strong>{episode_num}</strong></td>
<td>The episode number for the media item if item is episode.</td> <td>The episode number for the item if item is episode.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{episode_num00}</strong></td> <td><strong>{episode_num00}</strong></td>
<td>The two digit episode number.</td> <td>The two digit episode number.</td>
</tr> </tr>
<tr>
<td><strong>{track_num}</strong></td>
<td>The track number for the item if item is track.</td>
</tr>
<tr>
<td><strong>{track_num00}</strong></td>
<td>The two digit track number.</td>
</tr>
<tr> <tr>
<td><strong>{year}</strong></td> <td><strong>{year}</strong></td>
<td>The release year for the media item.</td> <td>The release year for the item.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{studio}</strong></td> <td><strong>{studio}</strong></td>
<td>The studio for the media item.</td> <td>The studio for the item.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{content_rating}</strong></td> <td><strong>{content_rating}</strong></td>
<td>The content rating for the media item. (e.g. TV-MA, TV-PG, etc.)</td> <td>The content rating for the item. (e.g. TV-MA, TV-PG, etc.)</td>
</tr> </tr>
<tr> <tr>
<td><strong>{directors}</strong></td> <td><strong>{directors}</strong></td>
<td>A list of directors for the media item.</td> <td>A list of directors for the item.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{writers}</strong></td> <td><strong>{writers}</strong></td>
<td>A list of writers for the media item.</td> <td>A list of writers for the item.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{actors}</strong></td> <td><strong>{actors}</strong></td>
<td>A list of actors for the media item.</td> <td>A list of actors for the item.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{genres}</strong></td> <td><strong>{genres}</strong></td>
<td>A list of genres for the media item.</td> <td>A list of genres for the item.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{summary}</strong></td> <td><strong>{summary}</strong></td>
<td>A short plot summary for the media item.</td> <td>A short plot summary for the item.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{tagline}</strong></td> <td><strong>{tagline}</strong></td>
@ -1339,11 +1347,11 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
</tr> </tr>
<tr> <tr>
<td><strong>{parent_rating_key}</strong></td> <td><strong>{parent_rating_key}</strong></td>
<td>The unique identifier for the item parent (season or album).</td> <td>The unique identifier for the item's parent (season or album).</td>
</tr> </tr>
<tr> <tr>
<td><strong>{grandparent_rating_key}</strong></td> <td><strong>{grandparent_rating_key}</strong></td>
<td>The unique identifier for the item grandparent (TV show or artist).</td> <td>The unique identifier for the item's grandparent (TV show or artist).</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -519,10 +519,10 @@ def build_notify_text(session=None, timeline=None, state=None):
available_params = {'server_name': server_name, available_params = {'server_name': server_name,
'server_uptime': server_uptime, 'server_uptime': server_uptime,
'streams': stream_count,
'action': state, 'action': state,
'datestamp': arrow.now().format(plexpy.CONFIG.DATE_FORMAT.replace('Do','').replace('zz','')), 'datestamp': arrow.now().format(plexpy.CONFIG.DATE_FORMAT.replace('Do','').replace('zz','')),
'timestamp': arrow.now().format(plexpy.CONFIG.TIME_FORMAT.replace('Do','').replace('zz','')), 'timestamp': arrow.now().format(plexpy.CONFIG.TIME_FORMAT.replace('Do','').replace('zz','')),
'streams': stream_count,
'user': user, 'user': user,
'platform': platform, 'platform': platform,
'player': player, 'player': player,
@ -563,6 +563,8 @@ def build_notify_text(session=None, timeline=None, state=None):
'season_num00': metadata['parent_media_index'].zfill(2), 'season_num00': metadata['parent_media_index'].zfill(2),
'episode_num': metadata['media_index'].zfill(1), 'episode_num': metadata['media_index'].zfill(1),
'episode_num00': metadata['media_index'].zfill(2), 'episode_num00': metadata['media_index'].zfill(2),
'track_num': metadata['media_index'].zfill(1),
'track_num00': metadata['media_index'].zfill(2),
'year': metadata['year'], 'year': metadata['year'],
'studio': metadata['studio'], 'studio': metadata['studio'],
'content_rating': metadata['content_rating'], 'content_rating': metadata['content_rating'],