mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Merge pull request #104 from JonnyWong16/stream_duration-notification
Stream duration notification option
This commit is contained in:
commit
b98c17e738
2 changed files with 7 additions and 1 deletions
|
@ -842,6 +842,10 @@ available_notification_agents = notifiers.available_notification_agents()
|
|||
<td width="150"><strong>{duration}</strong></td>
|
||||
<td>The duration (in minutes) for the item.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150"><strong>{stream_duration}</strong></td>
|
||||
<td>The stream duration (in minutes) for the item.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150"><strong>{progress}</strong></td>
|
||||
<td>The last reported offset (in minutes) for the item.</td>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# This file is part of PlexPy.
|
||||
# This file is part of PlexPy.
|
||||
#
|
||||
# PlexPy is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -300,6 +300,7 @@ def build_notify_text(session, state):
|
|||
|
||||
duration = helpers.convert_milliseconds_to_minutes(item_metadata['duration'])
|
||||
view_offset = helpers.convert_milliseconds_to_minutes(session['view_offset'])
|
||||
stream_duration = 0 if state == 'play' else int((time.time() - helpers.cast_to_float(session['started']) - helpers.cast_to_float(session['paused_counter'])) / 60)
|
||||
|
||||
progress_percent = helpers.get_percent(view_offset, duration)
|
||||
|
||||
|
@ -323,6 +324,7 @@ def build_notify_text(session, state):
|
|||
'album_name': item_metadata['parent_title'],
|
||||
'rating': item_metadata['rating'],
|
||||
'duration': duration,
|
||||
'stream_duration': stream_duration,
|
||||
'progress': view_offset,
|
||||
'progress_percent': progress_percent
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue