mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
Add {plex_url} as a notification option
This commit is contained in:
parent
65de742f96
commit
86aa21a8bb
2 changed files with 11 additions and 0 deletions
|
@ -1812,6 +1812,10 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
|
|||
<td><strong>{poster_url}</strong></td>
|
||||
<td>A URL for the movie, TV show, or album poster.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{plex_url}</strong></td>
|
||||
<td>The Plex URL to your server for the item.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{imdb_id}</strong></td>
|
||||
<td>The IMDB ID for the movie. <span class="small-muted">(e.g. tt2488496)</span>
|
||||
|
|
|
@ -569,6 +569,12 @@ def build_notify_text(session=None, timeline=None, notify_action=None, agent_id=
|
|||
progress_percent = helpers.get_percent(view_offset, duration)
|
||||
remaining_duration = duration - view_offset
|
||||
|
||||
# Build Plex URL
|
||||
metadata['plex_url'] = ('http://app.plex.tv/web/app#!/server/'
|
||||
+ plexpy.CONFIG.PMS_IDENTIFIER
|
||||
+ '/details/%2Flibrary%2Fmetadata%2F'
|
||||
+ rating_key)
|
||||
|
||||
# Get media IDs from guid and build URLs
|
||||
if 'imdb://' in metadata['guid']:
|
||||
metadata['imdb_id'] = metadata['guid'].split('imdb://')[1].split('?')[0]
|
||||
|
@ -725,6 +731,7 @@ def build_notify_text(session=None, timeline=None, notify_action=None, agent_id=
|
|||
'rating': metadata['rating'],
|
||||
'duration': duration,
|
||||
'poster_url': metadata.get('poster_url',''),
|
||||
'plex_url': metadata.get('plex_url',''),
|
||||
'imdb_id': metadata.get('imdb_id',''),
|
||||
'imdb_url': metadata.get('imdb_url',''),
|
||||
'thetvdb_id': metadata.get('thetvdb_id',''),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue