mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 08:16:06 -07:00
Add {remaining_duration} to notifications
* Also clean up/reorder notification parameters
This commit is contained in:
parent
dd5ba05c88
commit
76c1558473
2 changed files with 105 additions and 91 deletions
|
@ -841,57 +841,45 @@ available_notification_agents = notifiers.available_notification_agents()
|
||||||
</p>
|
</p>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
|
||||||
<td width="150"><strong>{user}</strong></td>
|
|
||||||
<td>The username of the person streaming.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{server_name}</strong></td>
|
<td width="150"><strong>{server_name}</strong></td>
|
||||||
<td>The name of your Plex Server.</td>
|
<td>The name of your Plex Server.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{player}</strong></td>
|
<td width="150"><strong>{user}</strong></td>
|
||||||
<td>The name of the device being used for playback.</td>
|
<td>The username of the person streaming.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{platform}</strong></td>
|
<td width="150"><strong>{platform}</strong></td>
|
||||||
<td>The type of client being used for playback.</td>
|
<td>The type of client being used for playback.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="150"><strong>{player}</strong></td>
|
||||||
|
<td>The name of the device being used for playback.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="150"><strong>{media_type}</strong></td>
|
||||||
|
<td>The type of media being played (movie, episode, track).</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{title}</strong></td>
|
<td width="150"><strong>{title}</strong></td>
|
||||||
<td>The title of the item being played back.</td>
|
<td>The title of the item being played.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{show_name}</strong></td>
|
<td width="150"><strong>{show_name}</strong></td>
|
||||||
<td>The title of the TV series being played back.</td>
|
<td>The title of the TV series being played.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{episode_name}</strong></td>
|
<td width="150"><strong>{episode_name}</strong></td>
|
||||||
<td>The title of the episode being played back.</td>
|
<td>The title of the episode being played.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="150"><strong>{artist_name}</strong></td>
|
||||||
|
<td>The name of the artist being played.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{album_name}</strong></td>
|
<td width="150"><strong>{album_name}</strong></td>
|
||||||
<td>The title of the album being played back if item is track.</td>
|
<td>The title of the album being played.</td>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="150"><strong>{transcode_decision}</strong></td>
|
|
||||||
<td>The transcode decisions for the media item.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="150"><strong>{year}</strong></td>
|
|
||||||
<td>The release year for the media item.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="150"><strong>{studio}</strong></td>
|
|
||||||
<td>The studio for the media item.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="150"><strong>{content_rating}</strong></td>
|
|
||||||
<td>The content rating for the media item. E.g. TV-MA, TV-PG, etc.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="150"><strong>{summary}</strong></td>
|
|
||||||
<td>A short plot summary for the media item.</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{season_num}</strong></td>
|
<td width="150"><strong>{season_num}</strong></td>
|
||||||
|
@ -909,6 +897,26 @@ available_notification_agents = notifiers.available_notification_agents()
|
||||||
<td width="150"><strong>{episode_num00}</strong></td>
|
<td width="150"><strong>{episode_num00}</strong></td>
|
||||||
<td>The two digit episode number.</td>
|
<td>The two digit episode number.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="150"><strong>{transcode_decision}</strong></td>
|
||||||
|
<td>The transcode decisions for the media item.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="150"><strong>{year}</strong></td>
|
||||||
|
<td>The release year for the media item.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="150"><strong>{studio}</strong></td>
|
||||||
|
<td>The studio for the media item.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="150"><strong>{content_rating}</strong></td>
|
||||||
|
<td>The content rating for the media item. (e.g. TV-MA, TV-PG, etc.)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="150"><strong>{summary}</strong></td>
|
||||||
|
<td>A short plot summary for the media item.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{rating}</strong></td>
|
<td width="150"><strong>{rating}</strong></td>
|
||||||
<td>The rating (out of 10) for the item.</td>
|
<td>The rating (out of 10) for the item.</td>
|
||||||
|
@ -921,6 +929,10 @@ available_notification_agents = notifiers.available_notification_agents()
|
||||||
<td width="150"><strong>{stream_duration}</strong></td>
|
<td width="150"><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>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="150"><strong>{remaining_duration}</strong></td>
|
||||||
|
<td>The remaining duration (in minutes) for the item.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="150"><strong>{progress}</strong></td>
|
<td width="150"><strong>{progress}</strong></td>
|
||||||
<td>The last reported offset (in minutes) for the item.</td>
|
<td>The last reported offset (in minutes) for the item.</td>
|
||||||
|
|
|
@ -320,25 +320,27 @@ def build_notify_text(session, state):
|
||||||
|
|
||||||
available_params = {'server_name': server_name,
|
available_params = {'server_name': server_name,
|
||||||
'user': session['friendly_name'],
|
'user': session['friendly_name'],
|
||||||
|
'platform': session['platform'],
|
||||||
'player': session['player'],
|
'player': session['player'],
|
||||||
|
'media_type': session['media_type'],
|
||||||
'title': full_title,
|
'title': full_title,
|
||||||
'show_name': item_metadata['grandparent_title'],
|
'show_name': item_metadata['grandparent_title'],
|
||||||
'episode_name': item_metadata['title'],
|
'episode_name': item_metadata['title'],
|
||||||
'platform': session['platform'],
|
'artist_name': item_metadata['grandparent_title'],
|
||||||
'media_type': session['media_type'],
|
'album_name': item_metadata['parent_title'],
|
||||||
|
'season_num': item_metadata['parent_index'],
|
||||||
|
'season_num00': item_metadata['parent_index'].zfill(2),
|
||||||
|
'episode_num': item_metadata['index'],
|
||||||
|
'episode_num00': item_metadata['index'].zfill(2),
|
||||||
'transcode_decision': transcode_decision,
|
'transcode_decision': transcode_decision,
|
||||||
'year': item_metadata['year'],
|
'year': item_metadata['year'],
|
||||||
'studio': item_metadata['studio'],
|
'studio': item_metadata['studio'],
|
||||||
'content_rating': item_metadata['content_rating'],
|
'content_rating': item_metadata['content_rating'],
|
||||||
'summary': item_metadata['summary'],
|
'summary': item_metadata['summary'],
|
||||||
'season_num': item_metadata['parent_index'],
|
|
||||||
'season_num00': item_metadata['parent_index'].zfill(2),
|
|
||||||
'episode_num': item_metadata['index'],
|
|
||||||
'episode_num00': item_metadata['index'].zfill(2),
|
|
||||||
'album_name': item_metadata['parent_title'],
|
|
||||||
'rating': item_metadata['rating'],
|
'rating': item_metadata['rating'],
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'stream_duration': stream_duration,
|
'stream_duration': stream_duration,
|
||||||
|
'remaining_duration': duration - view_offset,
|
||||||
'progress': view_offset,
|
'progress': view_offset,
|
||||||
'progress_percent': progress_percent
|
'progress_percent': progress_percent
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue