Add unique identifiers to notification options

This commit is contained in:
JonnyWong16 2016-01-27 19:51:58 -08:00
parent bc52ac3559
commit 95f92bd292
2 changed files with 28 additions and 1 deletions

View file

@ -1224,6 +1224,10 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<td><strong>{transcode_audio_channels}</strong></td>
<td>The audio channels of the transcoded media.</td>
</tr>
<tr>
<td><strong>{user_id}</strong></td>
<td>The unique identifier for the user.</td>
</tr>
</tbody>
</table>
<table class="notification-params">
@ -1323,6 +1327,22 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<td><strong>{duration}</strong></td>
<td>The duration (in minutes) for the item.</td>
</tr>
<tr>
<td><strong>{section_id}</strong></td>
<td>The unique identifier for the library.</td>
</tr>
<tr>
<td><strong>{rating_key}</strong></td>
<td>The unique identifier for the item.</td>
</tr>
<tr>
<td><strong>{parent_rating_key}</strong></td>
<td>The unique identifier for the item parent (season or album).</td>
</tr>
<tr>
<td><strong>{grandparent_rating_key}</strong></td>
<td>The unique identifier for the item grandparent (TV show or artist).</td>
</tr>
</tbody>
</table>
</div>

View file

@ -456,6 +456,7 @@ def build_notify_text(session=None, timeline=None, state=None):
transcode_video_height = ''
transcode_audio_codec = ''
transcode_audio_channels = ''
user_id = ''
# Session values
if session:
@ -498,6 +499,7 @@ def build_notify_text(session=None, timeline=None, state=None):
transcode_video_height = session['transcode_height']
transcode_audio_codec = session['transcode_audio_codec']
transcode_audio_channels = session['transcode_audio_channels']
user_id = session['user_id']
progress_percent = helpers.get_percent(view_offset, duration)
@ -549,6 +551,7 @@ def build_notify_text(session=None, timeline=None, state=None):
'transcode_video_height': transcode_video_height,
'transcode_audio_codec': transcode_audio_codec,
'transcode_audio_channels': transcode_audio_channels,
'user_id': user_id,
'title': full_title,
'library_name': metadata['library_name'],
'show_name': show_name,
@ -570,7 +573,11 @@ def build_notify_text(session=None, timeline=None, state=None):
'summary': metadata['summary'],
'tagline': metadata['tagline'],
'rating': metadata['rating'],
'duration': duration
'duration': duration,
'section_id': metadata['section_id'],
'rating_key': metadata['rating_key'],
'parent_rating_key': metadata['parent_rating_key'],
'grandparent_rating_key': metadata['grandparent_rating_key']
}
# Default subject text